尝试 git clone
时,我会遇到错误:
git clone https://github.com/laradock/laradock.git
Cloning into 'laradock'...
remote: Enumerating objects: 8606, done.
remote: Total 8606 (delta 0), reused 0 (delta 0), pack-reused 8606
Receiving objects: 100% (8606/8606), 8.09 MiB | 6.92 MiB/s, done.
Resolving deltas: 100% (4551/4551), done.
fatal: multiple updates for ref 'refs/remotes/origin/LaraDock-ToolBox' not allowed
我试图克隆的任何回购都会发生这种情况。我正在运行通过homebrew
安装的git version 2.21.0
。
还有其他人概括了这个问题吗?不确定这里发生了什么...
谢谢!
好吧,我似乎已经解决了问题。从我的.gitConfig中删除以下内容似乎可以解决问题,但我不确定为什么:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
我知道git v2.21.0
是几天前才发布的,所以也许在引擎盖下发生了一些变化。我需要查看发行说明。
无论如何,希望这可以帮助某人!
我更换
[remote "origin"]
tagopt = --tags
# modify next line:
fetch = +refs/heads/*:refs/remotes/origin/*
push = +refs/archive/*:refs/archive/*
with:
[remote "origin"]
tagopt = --tags
# modified this line:
fetch = +refs/archive/*:refs/archive/*
push = +refs/archive/*:refs/archive/*
它解决了问题。git branch -a
仍然显示所有远程分支
我的~/.gitconfig
中的其他潜在有趣的事情:
[core]
ignorecase = false
fileMode = false
eol = lf
autocrlf = false
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[uploadpack]
allowReachableSHA1InWant = true
[gc]
autodetach = false
pruneExpire = never
reflogExpire = never
auto = 0
我也有类似的问题。但是,相反,在检查了我的.gitConfig之后,我意识到我有3个条目
fetch = refs/pull//head:refs/promotes/orient/pr/pr/
因此,解决方案仅仅是为了删除所有额外的条目,仅留下一个条目。
我还没有真正检查出为什么会发生的原因,这两个问题都不是什么,但是似乎基于远程origin
,Git首先获取了文件,并且按时解决第二和第三条条目仍然要求相同的条目文件,导致来自相同原点的同一回购的多个更新。