Skip to content

Instantly share code, notes, and snippets.

@gartenfeld
Created September 9, 2016 21:10
Show Gist options
  • Save gartenfeld/2f85a0cd4734fbd564cc4d4fae4eb2cd to your computer and use it in GitHub Desktop.
Save gartenfeld/2f85a0cd4734fbd564cc4d4fae4eb2cd to your computer and use it in GitHub Desktop.
Shell Fallback with Error-Muting
# 2 represents stderr
# 2> redirects stderr (to /dev/null mutes error output)
# || runs the second command only if the first one fails
alias gcm='git checkout maybe 2> /dev/null || git checkout master'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment