Skip to content

Instantly share code, notes, and snippets.

@mortenholmgaard
Created August 12, 2019 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mortenholmgaard/b5a95754e68c68d6d9db19f578d7ab32 to your computer and use it in GitHub Desktop.
Save mortenholmgaard/b5a95754e68c68d6d9db19f578d7ab32 to your computer and use it in GitHub Desktop.
Checkout branch or create branch if it does not exist
begin
sh("git checkout stage", log: false)
puts "git checkout stage"
rescue => ex
sh("git checkout -b stage")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment