Find out which branch has a certain tag – Git

Question:

I have a repository with several branches, and each branch has several tags. I want to find out which branch has a certain "tag_name" tag. How can I do this?

Answer:

You can use the command:

git branch --contains tags/<nome-tag>

Replace <nome-tag> with the tag you are looking for.

Scroll to Top