11

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?

Denio Mariz
  • 1,065
  • 1
  • 10
  • 12

1 Answers1

12

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.

Community
  • 1
  • 1
madsroskar
  • 1,138
  • 13
  • 26
  • 2
    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. – torek Feb 22 '17 at 12:13