Search code examples
mercurial

How can one change the name of a tag?


I have made a tag in mercurial:

hg tag release_123

Later on I found out that the name was wrong, it should be release_124. Is it possible to simply rename the tag or do I have to create a new one?


Solution

  • I would do it by removing the tag and then adding a new tag with the new name

    The Mercurial tag wiki explains how to remove a tag:

    How do I remove a tag?

    Either by

    • hg tag --remove tagname

    (this being the nearest equivalent to cvs tag -d)

    • adding tagname 0000000000000000000000000000000000000000 to the end of .hgtags

    • removing all references to tagname in .hgtags (but this might confuse the multiple-head tag collision resolution algorithm)