Created
February 3, 2018 20:12
-
-
Save t27/2acd75d335ff1cd22dcf65a180506174 to your computer and use it in GitHub Desktop.
Move a git tag on an older commit to a newer commit
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 | |
# usage | |
# > ./git-tag-update.sh <tagname> | |
TAGNAME=$1 | |
git push --delete origin $TAGNAME # Deletes old tag from the server | |
git tag --delete $TAGNAME # Delete the old tag from local branch | |
git tag $TAGNAME # add the tag to the latest commit | |
git push --tags # persist tags to the server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment