1

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. :)

KIAaze
  • 340
  • 1
  • 13

2 Answers2

3
#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?

Community
  • 1
  • 1
KIAaze
  • 340
  • 1
  • 13
0

git describe now supports a --match option that can filter the tags that will be selected

William Pursell
  • 204,365
  • 48
  • 270
  • 300