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?
Using the answers above, this is my alias one-liner for
.gitconfig
. Replaces existing tag and preserves the commit date.Improvements?
@Andy 's solution
is wrong. After it, with
command, we will see stack tags with same name.
It add a new tag with same tag name and new message at commit
<tag-name>
. But it don't remove old tag. It's a special case of this command:But just
<old-tag>
is same with<tag-name>
.Correct solution is simple, just update tag is OK.
Remember, only ONE here.
If we want change tag, which isn't
HEAD
, we need an extra<commit>
argument.