简体   繁体   中英

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. Unfortunately, the git repository was created using cvs-import and has an ugly old tag, so I would like to change it.

How can I change the tag given when using "git describe"?

Note: I asked this on IRC today and found the answer myself in the end. 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

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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