Manish Kumar
Manish Kumar

Reputation: 1469

Git tag information - Which branch am I on?

Git tag commands provide information about all the tags on that repository. For example, when I run git tag on my repository, it displays

tag1.0
tag1.1
tag1.2

Let's say my repository has two branches. How would I know which branch the tag1.0 tag was related to?

Yes, I know that if I do git show tag1.0, I can tell whether this is the 1st branch or 2nd based on the previous changes. However, I'd like to know if there a more direct method exists. If it exists, what command would I need to use?

Upvotes: 3

Views: 221

Answers (1)

manojlds
manojlds

Reputation: 301037

You can do:

git branch --contains tag1.0

Upvotes: 3

Related Questions