Gitk has a nice habit of showing me Tags:, Follows: and Precedes: for commit. How do I get the same information from command line?
+3
A:
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
Ben James
2009-11-05 13:43:49
Follows: and Precedes: actually relate to tags, not commits. So your rev-list examples in fact answer different question. But that is ok, since 'git describe' is just what I was looking for. Thanks!
artemave
2009-11-05 15:05:13
OK -- sorry, I do not use gitk! But I'm glad I still gave something useful
Ben James
2009-11-05 16:02:01
The solution is `git describe` + `git describe --contains` (as per two answers)
Jakub Narębski
2009-11-06 19:53:16
Also there is `git describe --abbrev=0 <commit>` trick... and `git log --decorate`.
Jakub Narębski
2009-11-07 09:03:06
+2
A:
To show the tags that contain a commit (i.e. tags the precede a commit):
git tag --contains <commit>
Bombe
2009-11-05 13:53:18