76

Someone fixed a bug in HHVM in this commit:

https://github.com/facebook/hhvm/commit/796f986aba300b3f00b9ece0bf654c452ee217be

I want to know if this commit is already part of the official releases.

Is there a way to list the releases/tags that contain this commit, either on GitHub, or in a local clone of the GIT repository on my machine?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
  • Possible duplicate of [How to list branches that contain a given commit](http://stackoverflow.com/questions/1419623/how-to-list-branches-that-contain-a-given-commit) – jcm Jan 11 '15 at 11:34
  • I assume that the versions have been tagged. If so, then see: [How to tell which commit a tag points to in Git?](http://stackoverflow.com/questions/1862423/how-to-tell-which-commit-a-tag-points-to-in-git) – lurker Jan 11 '15 at 11:35
  • Here's a better one [How to list all tags that contain a commit](http://stackoverflow.com/questions/7923091/how-to-list-all-tags-that-contain-a-commit). – jcm Jan 11 '15 at 11:37
  • Indeed that's a dup, sorry guys. At least on this project, releases and tags are identical. Can someone write an answer and point to the solution? – BenMorel Jan 11 '15 at 11:41

2 Answers2

66

GitHub now shows you the tags containing a commit automatically when you open a commit (click on the ... to show all tags):

enter image description here

Cristian
  • 5,877
  • 6
  • 46
  • 55
  • 5
    what does it mean if there is no branch or tag info like here https://github.com/square/okhttp/commit/3c259c8a2f092c8e323406e4cf85c5c9a20baa55 ? – OlegYch Dec 10 '18 at 15:23
  • OlegYch: They are [dangling commits](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefdanglingobjectadanglingobject) which [will be removed after a while with `gc`](https://git-scm.com/docs/user-manual/2.1.4#checking-for-corruption). – darkdragon Jun 20 '20 at 20:52
62

As pointed out by fellow members in the comments, this is already covered here, and is as easy as:

git tag --contains <commit>
Community
  • 1
  • 1
BenMorel
  • 34,448
  • 50
  • 182
  • 322