It happens more often than not, I am on a slow internet connection and I have to clone a decently-huge git repository. The most common issue is the connection closes and the whole clone is cancelled.
After a lot of trial and errors and a lot of “remote end hung up unexpectedly” I have a way that works for me. The idea is to do a shallow clone first and then update the repositroy with its history.
And, that’s all folks