Borek Borek - 8 months ago 49
Git Question

How to use `git describe` on repos without tags?

For most of our repos, we use

git describe --tags
to print a version number like
. 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?


git-describe offers --always to give a fallback option. If you have any tags those are used, otherwise just the most recent commit id.