Pete Freitag Pete Freitag

Solved: Git Clone Large Repo Download Errors

Published on January 08, 2020
By Pete Freitag
web

When attempting to clone a large git repository over https, hosted on an on premise GitLab instance, I kept getting the error:

error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

After attempting to clone it a few times, I tried just downloading the zip from GitLab, this would also fail halfway through. Next I thought I'd give cloning it with --depth 1 a try, this is a trick I've used before to improve the speed of cloning a repo within a CI (where you are downloaded it fresh every time and don't need all the history). Setting the depth to 1 helped reduce the size it was downloading, but I couldn't get it fully cloned without an error.

The Solution

Finally, I tried switching from http to ssh, this did the trick. I'm guessing the web server that was running GitLab might have had some timeouts set that were preventing it from working over http, but using ssh avoided that problem and it worked first try.



git gitlab ssh curl

Solved: Git Clone Large Repo Download Errors was first published on January 08, 2020.


Discuss / Follow me on Twitter ↯

Comments

Thanks for sharing the solution!
by Anonymous on 12/04/2020 at 8:53:14 AM UTC