Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I show just the message for an annotated tag?

Tags:

git

git-tag

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?

like image 911
Mark Bolusmjak Avatar asked Jul 15 '15 02:07

Mark Bolusmjak


People also ask

How do you tell if a tag is annotated or not?

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.

What is the difference between annotated and non annotated tags?

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.

Which command is used to create an annotated tag?

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.

What is the difference between lightweight and annotated tags?

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.


1 Answers

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

like image 182
jthill Avatar answered Sep 20 '22 23:09

jthill