开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜