Reputation: 53251
For most of our repos, we use git describe --tags
to print a version number like v1.0.4-14-g2414721
. However, this fails if the repo doesn't have any tags yet.
Is there a flag of git describe
or something similar that would work around this?
Upvotes: 4
Views: 374
Reputation: 33203
git-describe offers --always
to give a fallback option. If you have any tags those are used, otherwise just the most recent commit id.
Upvotes: 4