简体   繁体   English

使用git describe时如何更改给定的标记?

[英]How can I change the tag given when using git describe?

I want to use "git describe" to get the "revision number" of the application. 我想使用“ git describe”来获取应用程序的“修订号”。 Unfortunately, the git repository was created using cvs-import and has an ugly old tag, so I would like to change it. 不幸的是,git存储库是使用cvs-import创建的,并且具有一个难看的旧标签,因此我想对其进行更改。

How can I change the tag given when using "git describe"? 使用“ git describe”时,如何更改给定的标签?

Note: I asked this on IRC today and found the answer myself in the end. 注意:我今天在IRC上提出了这个问题,最后我自己找到了答案。 Thought it might be useful to others too. 认为它对其他人也可能有用。 :) :)

#create a new anotated tag because by default git describes only looks for those
git tag -a NEWTAG

#push the new tags to the remote repository
git push --tags

cf: http://www.kernel.org/pub/software/scm/git/docs/git-describe.html cf: http : //www.kernel.org/pub/software/scm/git/docs/git-describe.html

This may also be of interest to you: How can I pass the output of a command as a compiler flag through a Qt project file? 您可能对此也很感兴趣: 如何通过Qt项目文件将命令的输出作为编译器标志传递?

git describe现在支持--match选项,该选项可以过滤将要选择的标签

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM