Created
October 5, 2014 02:48
-
-
Save jloveland/22b641ace8e64df189b8 to your computer and use it in GitHub Desktop.
rename a git tag
This file contains hidden or 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 | |
echo "enter new tag: " | |
read new | |
echo "enter old tag: " | |
read old | |
echo "new tag: " $new | |
echo "old tag: " $old | |
read -r -p "Are you sure? [y/N] " response | |
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]] | |
then | |
echo "Renaming tag" | |
git checkout tags/$old | |
git tag $new $old | |
git tag -d $old | |
git push origin :refs/tags/$old | |
git push --tags | |
else | |
echo "Exiting..." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment