Git cloning error: 'fatal: multiple updates fo

2020-08-09 08:01发布

问题:

I'm getting an error when trying to git clone a repository:

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

This is happening for any repo I try to clone. I am running git version 2.21.0 installed via homebrew.

Has anyone else encoutered this issue? Not really sure whats going on here...

Thanks!

回答1:

Well, I seem to have fixed the issue. Removing the following from my .gitconfig seemed to do the trick, but I am not sure why:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*

I know that git v2.21.0 was just released a few days ago, so maybe something changed under the hood. I need to check out the release notes.

Anyways, hope this can help someone!