franksands
franksands

Reputation: 2053

git status with tag information

When I use git status it shows the current branch I'm in or the commit if it is detached. Is there any way to show the tags for the current commit? I know about git describe and git tag, what I would like to know is if there is any way to show the tag information when calling git status

Upvotes: 0

Views: 1185

Answers (1)

joanis
joanis

Reputation: 12221

I don't know any way to get that information from git status, but git show or git show HEAD will provide it. You can also give --decorate to git log to have it print that information on the history as well.

This command will show one line of output, including the tags:

git show --format=oneline --no-patch

And this command will show just the tags and branches that point to HEAD:

git show --format=%d --no-patch

Upvotes: 1

Related Questions