Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub : Tags that include a specific commit

On Github, when you access the page corresponding to a commit - like this - you can see the following:

Commit page

I imagine that next to the branch (master) the page is showing the repository tags that include that specific commit (in this case: 4.8.0, 4.7.1, 4.7.0, 4.6.2, 4.6.1 and 4.6.0).

Is there a way to access that information through GitHub REST API, or through GIT command line tools?

like image 863
Guillermo Guardastagno Avatar asked Jun 24 '26 02:06

Guillermo Guardastagno


1 Answers

I'm not sure about the REST API, but you can do this from Git's CLI

git tag --contains <commit>

This will output all tags reachable from this commit. <commit> can be a commit or object... ie a branch name, tag name, or sha.

like image 97
Kevin Burdett Avatar answered Jun 25 '26 23:06

Kevin Burdett



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!