Git: How to find out on which branch a tag is?

Even shorter:

git branch --contains tags/<tag>

(it works for any tree-ish reference)


If you can find which commit a tag refers to:

 git rev-parse --verify tags/<tag>^{commit}
 # or, shorter:
 git rev-parse tags/<tag>~0

Then you can find which branch contain that commit.

git branch --contains <commit>

As commented below by user3356885, for the fetched branches (branches in remotes namespace)

git branch -a --contains tags/<tag>
git branch -a --contains <commit>

As noted in Pyr3z‘s answer, for each candidate tag listed above, you can add:

git log -1 --pretty='%D' TAG

That will show the branches associated to that tag.

Leave a Comment