Created
December 17, 2010 22:26
-
-
Save slyphon/745824 to your computer and use it in GitHub Desktop.
just a shortcut for creating a tag object and (optionally) pushing it
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/bash | |
if [[ $# -lt 1 ]]; then | |
echo "Usage $(basename $0) [-p] tagname" >&2 | |
echo 'the -p option will run `git push --tags` after creating the new tag' >&2 | |
exit 1 | |
fi | |
DO_PUSH='' | |
while getopts ':p' option | |
do | |
case $option in | |
p) DO_PUSH='yes' ;; | |
esac | |
done | |
shift $(($OPTIND - 1)) | |
git tag -am "$1" $1 | |
if [[ $DO_PUSH == 'yes' ]]; then | |
git push --tags | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment