开发者

getting commits' tag in git

开发者 https://www.devze.com 2022-12-10 09:56 出处:网络
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

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

精彩评论

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

关注公众号