Slow speed on git clone

Sometimes when I have to clone a huge repository from Github, I find that the fetch speed can be extremely slow (KB/s).

There are two tricks I try for a quick cloning:

  • Kill the command and try again. Do this a few times, see if you can get a faster connection. This works most of the times.

  • Fetch only the latest revision first and then fetch the rest:

$ git clone --depth=1 git@github.com:joe/hello-world.git
$ cd hello-world
$ git fetch --unshallow

Tried with: Git 1.9.1 and Ubuntu 14.04

Advertisements

How to git clone only the latest revision

Most of the time when I clone a Github repository, I just need the latest revision. There is no point wasting my time cloning the entire repository with all the changes.

To do this:

$ git clone --depth=1 https://github.com/joe/foobar.git

Tried with: Git 1.9.1