Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Clone is too slow

Tags:

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

like image 483
alvin Avatar asked Apr 02 '13 00:04

alvin


People also ask

Why is cloning taking so long?

Part 3: Why Does Cloning Process Take So Long? Cloning your disk requires not only the right software but also that all your hardware and your operating system are in good condition; otherwise, this procedure will take longer than it should.

What does depth 1 do in git clone?

git clone --depth=1 <url> creates a shallow clone. These clones truncate the commit history to reduce the clone size. This creates some unexpected behavior issues, limiting which Git commands are possible. These clones also put undue stress on later fetches, so they are strongly discouraged for developer use.

What is git shallow clone?

Git shallow clone lets you pull down just the latest commits, not the entire repo history. So if your project has years of history, or history from thousands of commits, you can select a particular depth to pull.

What are git cloners?

git clone is primarily used to point to an existing repo and make a clone or copy of that repo at in a new directory, at another location. The original repository can be located on the local filesystem or on remote machine accessible supported protocols. The git clone command copies an existing Git repository.


1 Answers

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!

like image 171
hzwzw Avatar answered Sep 20 '22 00:09

hzwzw