Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
445 views
in Technique[技术] by (71.8m points)

How to make git clone faster with multiple threads?

My internet speed to github was never fast, and it's lingering at 50kb/s (my internet speed is 20mbit which is not very fast but still much faster than this). The repository is multi-gb by my estimates, so it'll take a very long time.

Does git support downloading the objects using multiple-threads so I can max-out my internet speed?

question from:https://stackoverflow.com/questions/26957237/how-to-make-git-clone-faster-with-multiple-threads

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can at least try and mitigate the issue, with a shallow clone (meaning not cloning the all history):

git clone --depth 1 <repository>

Make sure to have a git 1.9+, as I explained in "Is git clone --depth 1 (shallow clone) more useful than it makes out?".

Note: Git 2.5 (Q2 2015) even supports a single fetch commit!See "Pull a specific commit from a remote git repository".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...