Last active
August 29, 2015 14:02
-
-
Save raulmarcosl/6833093731b851f40845 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$#" -ge 1 ]; then | |
echo "Are you sure (y/n)?" | |
read answer | |
# Abort unless enter was pressed, or "y" written | |
if [ "$answer" = "y" ] || [ "$answer" = "" ]; then | |
git checkout "$@" | |
else | |
echo "aborted" | |
fi | |
else | |
echo "Incorrect number of arguments" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instructions to ask before execute git checkout (aliased to git co):
Note: The bang at the start of the alias means "run the following as commands to the shell".