git致命:没有标签可以描述< sha1号码> [英] git fatal:No tags can describe <sha1 number>

查看:1212
本文介绍了git致命:没有标签可以描述< sha1号码>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用标签将它们应用于每晚构建。然后,我想使用 describe --tags --match< latest tag> 的输出来告诉我距离我的图像每晚的生成有多远。这是用于QA测试的。

I am using tags by applying them to nightly builds. Then later, I want to use the output of describe --tags --match <latest tag> to tell me how far from the nightly build my images are. This is for QA testing.

我刚刚在比当前标记更早的克隆中遇到错误。我运行git fetch --tags,所以我在git标签输出中看到标签,但是当我运行 git describe --tags --match< tagname> 时,我得到致命:没有标签可以描述< head sha1版本号> 。在这一点上,我无法做一个git pull来更新工作区。为什么会发生这种情况,是否有解决方法?非常感谢

I just ran into an error in a clone that is older than the current tag. I ran git fetch --tags, so I see the tag in git tag output, but when I run git describe --tags --match <tagname>, I get fatal: No tags can describe <head sha1 version number>. I cannot do a git pull to update the workspace at this point. Why does this happen and is there a workaround? Thanks very much

推荐答案

发生这种情况的原因是您只获取标记,而不是标记的提交历史记录。 git describe 使用此历史记录,这就是为什么它有错误。

It happens because you only fetch the tag, not the commit history of the tag. git describe uses this history, which is why it has an error.

唯一的解决方法是获取repo的历史记录包含您感兴趣的标签,使用 git fetch<远程名称>

The only workaround is to fetch repo's history containing the tag you're interested in, using git fetch <remote-name>.

这篇关于git致命:没有标签可以描述&lt; sha1号码&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆