Show which git tag you are on?

Posted oxspirt

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Show which git tag you are on?相关的知识,希望对你有一定的参考价值。

 

git查看当前代码是在那个tag?

reference: https://stackoverflow.com/questions/3404936/show-which-git-tag-you-are-on

-----------------------------------------------------

Edit: Jakub Nar?bski has more git-fu. The following much simpler command works perfectly:

 

git describe --tags

 

(Or without the --tags if you have checked out an annotated tag. My tag is lightweight, so I need the --tags.)

 

original answer follows:

 

git describe --exact-match --tags $(git log -n1 --pretty=‘%h‘)

 

Someone with more git-fu may have a more elegant solution...

 

This leverages the fact that git-log reports the log starting from what you‘ve checked out. %h prints the abbreviated hash. Then git describe --exact-match --tags finds the tag (lightweight or annotated) that exactly matches that commit.

 

The $() syntax above assumes you‘re using bash or similar.

 

以上是关于Show which git tag you are on?的主要内容,如果未能解决你的问题,请参考以下文章

FANTASY:In which way do you think the world will end?

HDU 2199 Can you solve this equation?(二分搜索)

*Flower Bed

求助 Cannot feed value of shape (10000,) for Tensor 'Placeholder:0', which has shape '(?,

FlinkNo cluster id was specified. Please specify a cluster to which you would like to connect

Kafka - which is larger than the maximum request size you have configured with the max.request