Skip to content

Instantly share code, notes, and snippets.

@t27
Created February 3, 2018 20:12
Show Gist options
  • Save t27/2acd75d335ff1cd22dcf65a180506174 to your computer and use it in GitHub Desktop.
Save t27/2acd75d335ff1cd22dcf65a180506174 to your computer and use it in GitHub Desktop.
Move a git tag on an older commit to a newer commit
#!/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