How do I edit an existing tag message in Git?

Question

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. How would we do this?

Answer

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

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

How can I Remove .DS_Store files from a Git repository?

Specify an SSH key for git push for a given domain