How to list all tags pointing to a specific commit in git How to list all tags pointing to a specific commit in git git git

How to list all tags pointing to a specific commit in git


git tag --points-at HEAD

Shows all tags at HEAD, you can also substitute HEAD with any sha1 id.


You can use:

git tag --contains <commit>

that shows all tags at certain commit.It can be used instead of:

git tag --points-at HEAD

that is available only from 1.7.10.


git show-ref --tags -d | grep ^48eb354 | sed -e 's,.* refs/tags/,,' -e 's/\^{}//'

should work for both lightweight and annotated tags.