Not able to clone large repo code on git

git config --global http.postBuffer 524288000

git clone repo_url --depth 1

I have followed above steps and finally I have successfully cloned my code.


That looks like a curl error, typical of a slow internet connection which closes too soon.

As seen here, try a shallow clone (or switch to ssh)

git clone https://[email protected]/weexcel1/higher-education-haryana.g‌​it --depth 1

Even then, as I documented in 2011, you might need to raise the http.postBuffer

git config --global http.postBuffer 524288000

But the idea remains: starting with one commit depth can help.

From there, you can gradually increase the depth:

git fetch --depth=<number-of-commits>

And, after a few iteration:

git fetch --unshallow

First, try to download a smaller amount, so that when the network fails, you don't have to start from zero:
Taken From This Answer by ingyhere

First, turn off compression:

git config --global core.compression 0

Next, let's do a partial clone to truncate the amount of info coming down:

git clone --depth 1 <repo_URI>

When that works, go into the new directory and retrieve the rest of the clone:

git fetch --unshallow 

or, alternately,

git fetch --depth=2147483647

Now, do a regular pull:

git pull --all

I think there is a glitch with msysgit in the 1.8.x versions that exacerbates these symptoms, so another option is to try with an earlier version of git (<= 1.8.3, I think).

If this does not help, because your network is still too unstable or your repo still too large, try a different network - best would be a wired.

For me, that was not an option. VonC's Answer states to do git config --global http.postBuffer 524288000. Maybe you'll need to do git config --global https.postBuffer 524288000 instead, if you're using https.

Finally, what worked for me in the end:
Give up and use a different machine
If it works on your laptop, just pull that repo onto your laptop, then run

git bundle create /my/thumb/drive/myrepo.bundle --all  

And restore it on your other machine with

git clone /my/thumb/drive/myrepo.bundle

Tags:

Git