How to rename a tag already pushed to a remote git repository


Sometimes when you work on a repository that isn’t managed by one person, the tagging becomes a mess. Here’s a way to clean it up.

  1. Rename the tag locally:
    git tag new-tag-name old-tag-name
  2. Push to remote:
    git push origin new-tag-name
  3. Delete tag locally:
    git tag -d old-tag-name
  4. Push to remote:
    git push origin :refs/tags/old-tag-name

 

 


Leave a Reply

Your email address will not be published. Required fields are marked *