[英]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 v1.0.4-14-g2414721
. 对于我们的大部分回购,我们使用
git describe --tags
来打印版本号,如v1.0.4-14-g2414721
。 However, this fails if the repo doesn't have any tags yet. 但是,如果repo还没有任何标签,则会失败。
Is there a flag of git describe
or something similar that would work around this? 是否有一个
git describe
的标志或类似的东西可以解决这个问题?
git-describe offers --always
to give a fallback option. git-describe提供 -
--always
提供后备选项。 If you have any tags those are used, otherwise just the most recent commit id. 如果您使用了任何标记,则只使用最新的提交ID。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.