Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does git tag --contains work?

Tags:

git

Since a few days ago I've being trying to identify in which release -specified by a tag- an specific fix -specified by a commit- was deployed. Some posts here posted that git tag --contains is the way to gather this information, however the documentation of the option seems obscure to me:

--contains [commit]: Only list tags which contain the specified commit (HEAD if not specified).

From what I've being reading so far, a tag in git is just a pointer to a specific commit, so it is not clear how a commit reference can "contain" another commit reference. Do you know how git tag --contains obtains the information it produces?

like image 261
Guillermo Guardastagno Avatar asked Oct 16 '25 03:10

Guillermo Guardastagno


1 Answers

When tag contains another commit, it means that this commit is one of its ancestors.

like image 95
Igal S. Avatar answered Oct 18 '25 21:10

Igal S.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!