Translate

Thursday, September 3, 2015

How to rename a tag in GIT






In this post, I will teach you how to rename a tag in git.

Actually, it is pretty easy.


I am going to rename the tag called myOldTag to myNewTag.

Step 1: we create an alias called "myNewTag"
  
     git tag myNewTag myOldTag

  

Step 2: we delete the myOldTag  tag locally
  
     git tag -d myOldTag

  

Step 3: we tell to git repository that myoldTag has been deleted
  
     git push origin :refs/tags/myOldTag

  

Step 4: we save the changes on GIT
  
     git push --tags

  

No comments:

Post a Comment