Skip to content

Instantly share code, notes, and snippets.

@fieldform
Created April 21, 2014 18:17
Show Gist options
  • Save fieldform/11151361 to your computer and use it in GitHub Desktop.
Save fieldform/11151361 to your computer and use it in GitHub Desktop.
tagging a git branch
# git-tag.sh
tag=$(git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3)
tag+="_"
tag+=$(date +"%Y%m%d")
read -p "What's the tag count for today? " n
tag+=$n
git tag "$tag"
while true; do
read -p "Push tag? " yn
case $yn in
[Yy]* ) git push --tags; break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment