getting commits' tag in git
Gitk has a nice habit of showing me Tags:, Follows: and Precede开发者_如何学运维s: for commit. How do I get the same information from command line?
To show the tags that contain a commit (i.e. the tags that the commit precedes):
git tag --contains <commit>
To show the tag of a commit:
$ git describe --tags <commit>
To show the preceding commit:
$ git rev-list -1 <commit>^
To show the following commit:
$ git rev-list -1 <commit>..HEAD
精彩评论