Pagine

Friday 5 May 2017

How to rename a tag with git

The tag rename operation is not atomic but more steps are needed.
1) Create the tag with new name from old tag:
 git tag <new_tag> <old_tag>
2) Delete the old tag from local repository:
 git tag -d <old_tag>
3) Delete the old tag from remote repository:
 git push origin :refs/tags/<old_tag>
4) Push the local tag in remote repository:
 git push --tags
5) Lastly synchronize the tag list among local and remote repositories:
 git fetch -f

No comments:

Post a Comment