Skip to content

Instantly share code, notes, and snippets.

@da-n
Created April 5, 2014 22:01
Show Gist options
  • Save da-n/9998623 to your computer and use it in GitHub Desktop.
Save da-n/9998623 to your computer and use it in GitHub Desktop.
Rename a tag in git

Rename a git tag old to new:

git tag new old
git tag -d old
git push origin :refs/tags/old
git push --tags

The colon in the push command removes the tag from the remote repository. If you don't do this, git will create the old tag on your machine when you pull.

-- source http://stackoverflow.com/a/5719854/695454

@seb86
Copy link

seb86 commented Oct 12, 2021

Thanks 😄

@gitmatheus
Copy link

Thanks!

@ChrisAcrobat
Copy link

ChrisAcrobat commented Nov 3, 2021

⚠️ Warning ⚠️

Apparently this also removes the linked release.
EDIT:
It might not entirely get removed. If the release is gone, open https://github.com/ACCOUNT/REOO/releases/tag/OLD. If the link work you might be able to see the linked release there. Open it and edit the release to use the new tag instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment