'RPC failed: curl 56 failure when receiving data from the peer

I have just created a small corporate repository on Azure ( 1 commit per each of 2 branches, totall about 200mb of repo), then I deleted local repository. When I try to clone it to my local machine back( I assume proxy might be an issue here ) I get:

RPC failed: curl 56 failure when receiving data from the peer. 

(However, if that is important, I also see that 100% objects received, 100% deltas resolved.) I am a very distant GIT user, but I have found a way to do the so called shallow clone of repo.

Question is: did I clone the repo with correctly? (it seems yes so far, but do the commands bellow look valid theoretically?):

git clone URL --depth=1 
git remote set-branches origin '*'
git fetch -v --depth=1

Question 2. I still do not understand what was the issue with the error curl56.. Any ideas? P.S. Isn't it possible to download zipped repo from remote to local machine and then somehow link the unzipped directory to the remote(upstream)?



Solution 1:[1]

This error message means that your machine was unable to receive all of the data from the remote side. It could be that the other side hung up or the connection was interrupted; it's really not possible to say without more information.

If you're using a proxy, then yes, that's likely the problem. Unfortunately, proxies, antivirus programs, non-standard firewalls, and TLS MITM boxes all tend to tamper with connections and they are probably the single biggest cause of this problem with Git. These problems are all due to this software improperly tampering with the connection and can't be fixed by Git. You should report this to your network administrator and ask them to drop or fix the proxy (preferably the former), or you can use a network that doesn't have one.

It is not possible to download a zipped directory and then fill in the Git repository from that. Git stores the entire history of the project and determines what it needs from negotiation which commits are common on both sides. There's no way to get one of those commits from the contents of a zip file, so you'd have no common commits and you'd have to send everything anyway.

The usual way to clone a repository as a shallow one and then unshallow it is this:

$ git clone --depth=1 https://github.com/git/git.git
$ cd git
$ git fetch --unshallow origin

Solution 2:[2]

Update the http post buffer value

git config --global http.postBuffer 1048576000

Solution 3:[3]

I recently had the same issue while working under a corporate proxy. 'git clone' worked fine for small repos, but not for others that are >100MB. The accepted answer is the best solution. If you are looking for a work-around you could use 'git clone' via SSH.

git clone [email protected]:v3/my-account/git

Check the Microsoft docs to setup your SSH key: https://docs.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops

You could then change the remote repo from SSH to Https via:

git remote set-url origin [email protected]/my-account/git

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bk2204
Solution 2 Raveendra
Solution 3