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

For most of our repositions, we use git describe --tagsversion numbers for printing, for example v1.0.4-14-g2414721. However, this fails if repo has no tags yet.

Is there a flag git describeor something similar that will work around this?

+4
source share
1 answer

git-describe suggests --alwaysgiving a fallback option. If you have tags that are used, otherwise just the last commit id.

+4
source

Source: https://habr.com/ru/post/1658550/


All Articles