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

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

问题描述

我通过将标签应用于夜间构建来使用它们.稍后,我想使用 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 tag 输出中看到了该标签,但是当我运行 git describe --tags --match <tagname> 时,我得到 fatal: No标签可以描述 <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.

唯一的解决方法是使用 git fetch <remote-name> 获取包含您感兴趣的标签的 repo 历史记录.

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

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

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