How do I edit an existing tag message in git?

jared picture jared · Oct 18, 2011 · Viewed 77.8k times · Source

We have several annotated tags in our git repository. The older tags have bogus messages that we would like to update to be in our new style.

% git tag -n1
v1.0 message
v1.1 message
v1.2 message
v2.0 Version 2.0 built on 15 October 2011.

In this example, we would like to make v1.x messages look like the v2.0 message. Anyone know how we would do this?

Answer

Andy picture Andy · Oct 18, 2011

git tag <tag name> <tag name>^{} -f -m "<new message>"

This will create a new tag with the same name (by overwriting the original).