Skip to content

Instantly share code, notes, and snippets.

@ZeroDragon
Created January 13, 2018 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZeroDragon/ebcc51592d8e69c68a274cff2e922de6 to your computer and use it in GitHub Desktop.
Save ZeroDragon/ebcc51592d8e69c68a274cff2e922de6 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "Last tag is:"
git tag | sed -e '$!d'
echo "Want to tag current commit? type the name of the tag (leave empty to skip)"
read current
if [ "$current" != "" ]; then
git tag -a $current
fi
echo "Type the name of the tag you want to move (leave blank to skip)"
read movement
if [ "$current" != "" ]; then
git tag -af $movement
fi
read -p "Want to push all updated tags? (y/N)" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
git push origin :$movement
git push --tags
fi
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment