Git Clone is too slow
Solution 1
Maybe you can fetch only the latest revision first and then fetch the rest:
$ git clone --depth=1 [email protected]:joe/hello-world.git
$ cd hello-world
$ git fetch --unshallow
Thanks this article!
Solution 2
If you, like me, have configured TortoiseGit to use Putty's plink to connect (and use pageant, etc...), this might help you:
Try enabling in Putty (Default Settings) the following settings:
- SSH -> Auth: "Allow agent forwarding" (I believe this is the one that changes "everything")
- SSH -> "Enable Compression"
- Session -> Select "Default Settings" -> Save
For me, this resulted in going from 143.00 KiB/s to 4.50 MiB/s
Hope this helps.
Solution 3
There are two issues at play here:
- Your OpenSSL is not up to date
- The SSH protocol is slower than HTTPS (but not by much)
Part 1. OpenSSL
After following the directions from the article, http://darrell.mozingo.net/2011/09/29/painfully-slow-clone-speeds-with-msysgit-gitextensions/, I successfully boosted my network throughput for the git clone
operation from 1 MiB/s to 28 MiB/s. This result was achieved by upgrading OpenSSL from version 0.9.8e to version 1.0.1e.
Part 2. SSH protocol
The SSH protocol a little bit slower than the HTTPS protocol, but not enough to warrant the speed differences I mentioned in Part 1 or what you are seeing. Please read through this article for more information on the Git protocols: http://media.pragprog.com/titles/tsgit/chap-008-extract.html.
Related videos on Youtube
alvin
Updated on September 21, 2020Comments
-
alvin over 3 years
This is my first time to construct the git server. When I use TortoiseGit-1.8.1.0-32bit to handle the operation, everything is fine!
But if i use the
git clone
command or git bash, the git clone process speed is so slow. I've attached two images showing the relativegit clone
transfer speeds below.Can anybody give me some suggestions?
-
owl about 11 yearsDefine "slow" please. Showing the output of the command would help us diagnose the problem as well.
-
wRAR about 11 years@RyanBigg see the links
-
owl about 11 yearsIs Tortoise configured any differently?
-
VonC about 11 yearsDoes superuser.com/questions/485638/… help? (one of the answers at least)
-
alvin about 11 yearsWhen i use TortoiseGit, the speed is normal. Only use git command or git bash, the speed is slow down.
-
Himanshu Mori over 5 yearsthe only thing "worked for me".. disconnecting and connecting pc to wifi... in my office..
-
-
richoffrails about 10 yearsHey, you said you're using OpenSSL 1.0.1e. This is a vulnerable version to the Heartbleed expolit. I recommend upgrading to 1.0.1g or later as soon as possible.
-
Mark about 10 yearsOpenSSH (the client) doesn't use OpenSSL in a way that makes him vulnerable to Heartbleed, I don't think.
-
v.oddou almost 9 yearsYour typical msysgit comes with OpenSSL 4, from 2007, which has the bug. You can use version 6 (Jun 2015) of OpenSSL, built by mls-soft to save the day.