Git clone错误警告:refname''不明确.Git通常不会创建以40个十六进制字符结尾的引用

 JUN-围脖 发布于 2023-02-11 16:18

克隆过程中出现此错误

remote: warning: refname '4e810d87701e09df2949cb33e731052aa05d2c76' is ambiguous.
remote: Git normally never creates a ref that ends with 40 hex characters
remote: because it will be ignored when you just specify 40-hex. These refs
remote: may be created by mistake. For example,
remote: 
remote:   git checkout -b $br $(git rev-parse ...)
remote: 
remote: where "$br" is somehow empty and a 40-hex ref is created. Please
remote: examine these refs and maybe delete them. Turn this message off by
remote: running "git config advice.objectNameWarning false"

Senthil A Ku.. 12

在克隆过程中,我收到此错误消息,发现使用此名称创建了一个标记(如40-hex ref).

当您收到此错误时,您可以查找具有不明确值的分支或标记名称,如果不需要ref,则将其删除

$ git tag | grep 4e810d87701e09df2949cb33e731052aa05d2c76
4e810d87701e09df2949cb33e731052aa05d2c76

$ git tag -d 4e810d87701e09df2949cb33e731052aa05d2c76


funroll.. 6

在我的情况下,它是一个分支而不是标签.

要查找ref是标记还是分支:

$ git branch -a | grep 4e810d87701e09df2949cb33e731052aa05d2c76
$ git tag | grep 4e810d87701e09df2949cb33e731052aa05d2c76

请注意,您可能希望在删除分支或标记之前保存它.(当然,使用不同的名称.)

这是我如何摆脱它:

$ git branch -d 4e810d87701e09df2949cb33e731052aa05d2c76
$ git push origin :4e810d87701e09df2949cb33e731052aa05d2c76

在我的情况下,错误只出现在git clone --mirror- 通常不是问题.

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有