How to list all tags that contain a commit?

git tag --contains <commit>

Note that you need git 2.0.x (Q3 2014) in order to list all tags for a certain commit if you have a large repo

See commit cbc60b6 by Jean-Jacques Lafay (lanfeust69):

git tag --contains: avoid stack overflow

In large repos, the recursion implementation of contains(commit, commit_list) may result in a stack overflow. Replace the recursion with a loop to fix it.

This problem is more apparent on Windows than on Linux, where the stack is more limited by default.

See also this thread on the msysGit list.

Tags:

Git