13

I created a tag but didn't use -m option, so my tag is not associated with a message (is not annotated). How can I add a message to this already created tag?

1 Answer 1

14

As described in this question, you can override a tag with the force option. (-f or --force).

Create a tag with the same name as the tag you want to override, add your -m option, and add the force option.

If the tag is for an earlier commit, you can supply the hash of the commit the tag is for as an argument to the git tag-command, as described in the git docs.

Sign up to request clarification or add additional context in comments.

1 Comment

It's worth noting (as in the answer to which you linked) that this replaces the existing tag. Someone who has already picked up the old version of the tag may not see the annotated tag, unless they take action to replace their copy as well. Since both tags will ultimately name the same commit, it won't matter which tag the "someone else" uses when it comes to looking at the commit itself, but unless they pick up the replacement, they will not see the annotated message.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.