Reputation: 20165
In some projects, the git describe --tags
command returns the exact lastest tag name, but in other cases it returns extra information:
project1> git describe --tags
2.0-BETA6
project2> git describe --tags
1.5-13-g4abc82e
Is there a way to call git describe so that it returns either just the first format (TAG only) or just the second format (TAG with commit info).
I am trying to update a java properies file to contain a property with the most recent tag, and another property with the most recent commit.
In case it matters, im using "git version 1.7.9.6 (Apple Git-31.1)"
Upvotes: 0
Views: 291
Reputation: 30207
To get the latest tag in all branches:
git describe --tags `git rev-list --tags --max-count=1`
Upvotes: 1