Document
How to complete a git clone for a big project on an unstable connection?

How to complete a git clone for a big project on an unstable connection?

I is had lot trouble getting repositories high latency satellite connection . I is had success config options commonly suggested repeated real explana

Related articles

PlayStation Cloud Games Best VPN deals: Save on NordVPN, ExpressVPN, and Surfshark Asian Dust What is a VPN Router? Do I Need One? [Updated] How to make 2 ingredient cloud play dough

I is had lot trouble getting repositories high latency satellite connection . I is had success config options commonly suggested repeated real explanation ought work . bandwidth is is couple Mb / s sufficient download large files ( hundreds MB ) reasonable time , instability connection causes fetch fail .

One solution that I haven’t seen mentioned here is to try with SSH instead of HTTPS (in combination with other suggestions like shallow cloning). This has been a lot more successful for me in cases where HTTPS would reliably fail. I imagine most people reading this are trying to clone from Github i.e. try setting up a key and using git clone --depth=1 --no-tags [email protected]:organisation/repo.git

A backup solution is to clone the repository somewhere else; ideally your own server, but since many folks don’t have access to that I’ve found Google Colab is very serviceable. This also works if SSH is blocked on your network:

!git clone --depth=1 --no-tags https://github.com/some/repo.git
!tar -czf repo.tar.gz repo

and then download the tarball via the file explorer in the browser. You could also copy to Google Drive, scp/rsync or even cloud storage if you have the means. Running git fetch --unshallow extracted tarball generally work .