Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git cloning: remote end hung up unexpectedly, tried changing postBuffer but still failing

I'm trying to clone a repository. The first time I got to 82%, then it didn't budge for half an hour so I cancelled the clone and started over. After that, every time I try to clone it, I get between 6-10%, and then it fails with the error "The remote end hung up unexpectedly, early EOF." I looked up the error and tried every solution I could find, with the most popular solution being to increase postBuffer to the maximum size. However, it still keeps failing every time.

I'm not sure if it makes a difference, but I'm not trying to check in code, which was what most of the other people reporting this issue seemed to be trying to do. I'm trying to clone a repository.

like image 837
Erica Stockwell-Alpert Avatar asked Feb 17 '15 20:02

Erica Stockwell-Alpert


People also ask

How do you fix a remote end hung up unexpectedly?

To solve the issue, change the settings of your buffer so that you have enough space available. You can increase the buffer value up to 2000000000.

What is git postBuffer?

From the git config man page, http. postBuffer is about: Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally.

How do you increase git buffer size to the largest individual file size of your repo?

Resolution. Increase the Git buffer size to the largest individual file size of your repo: git config --global http. postBuffer 157286400.


1 Answers

One option to reduce the size of the repo by cloning a single branch or my cloning only a certain amount of the past history.

git clone --depth=20 https://repo.git -b master

will clone only the master branch to a depth of 20 commits. Since this is a much smaller entity it will generally work, and then you can fetch other branches after. Not sure if you can recover the history after but for lots and lots of cases that is unimportant.

like image 91
phil_20686 Avatar answered Oct 15 '22 18:10

phil_20686