Git Clone is too slow

52,528

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:

  1. SSH -> Auth: "Allow agent forwarding" (I believe this is the one that changes "everything")
  2. SSH -> "Enable Compression"
  3. 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:

  1. Your OpenSSL is not up to date
  2. 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.

Share:
52,528

Related videos on Youtube

alvin
Author by

alvin

Updated on September 21, 2020

Comments

  • alvin
    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 relative git clone transfer speeds below.

    Can anybody give me some suggestions?

    Cloning via TortoiseGit

    Cloning via git command

    • owl
      owl about 11 years
      Define "slow" please. Showing the output of the command would help us diagnose the problem as well.
    • wRAR
      wRAR about 11 years
      @RyanBigg see the links
    • owl
      owl about 11 years
      Is Tortoise configured any differently?
    • VonC
      VonC about 11 years
      Does superuser.com/questions/485638/… help? (one of the answers at least)
    • alvin
      alvin about 11 years
      When i use TortoiseGit, the speed is normal. Only use git command or git bash, the speed is slow down.
    • Himanshu Mori
      Himanshu Mori over 5 years
      the only thing "worked for me".. disconnecting and connecting pc to wifi... in my office..
  • richoffrails
    richoffrails about 10 years
    Hey, 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
    Mark about 10 years
    OpenSSH (the client) doesn't use OpenSSL in a way that makes him vulnerable to Heartbleed, I don't think.
  • v.oddou
    v.oddou almost 9 years
    Your 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.