Skip to content

Instantly share code, notes, and snippets.

@raulmarcosl
Last active August 29, 2015 14:02
Show Gist options
  • Save raulmarcosl/6833093731b851f40845 to your computer and use it in GitHub Desktop.
Save raulmarcosl/6833093731b851f40845 to your computer and use it in GitHub Desktop.
#!/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
@manuartero
Copy link

So useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment