There seem to be ways in git to show the message of an annotated tag as well as the commit detail and other stuff git show the_tag
, or the name and the detail git tag -l -n100 the_tag
.
But what command shows the message/body and absolutely nothing else?
If the tag is an annotated tag, you'll see the message and the tag object, followed by the commit. If the tag is a lightweight tag, then you'll see only the commit object. If the current commit exactly matches that of a tag, then only the tag name is printed.
The difference between the commands is that one provides you with a tag message while the other doesn't. An annotated tag has a message that can be displayed with git-show(1), while a tag without annotations is just a named pointer to a commit.
To create a Git tag with a message, use the “git tag” command with the “-a” option for “annotated” and the “-m” option for message.
Git supports two types of tags: lightweight and annotated. A lightweight tag is very much like a branch that doesn't change — it's just a pointer to a specific commit. Annotated tags, however, are stored as full objects in the Git database.
When the convenience commands are doing too much, go for the core :-)
git for-each-ref refs/tags/$tagname --format='%(contents)'
for-each-ref docs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With