Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is cloning from github so slow

Tags:

git

Pulling a repo from github and it is very, very slow and I can't work out why.

C:\projects>git clone --depth 1 [email protected]:sawilde/opencover.git
Cloning into 'opencover'...
The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is SHA256:nThbg........................................
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.255.112' (RSA) to the list of known hosts.
remote: Enumerating objects: 1459, done.
remote: Counting objects: 100% (1459/1459), done.
remote: Compressing objects: 100% (829/829), done.
Receiving objects:  95% (1388/1459), 14.09 MiB | 8.00 KiB/s

I've tried a few things e.g. windows and ubuntu (via windows subsytem), full vs shallow clone, ssh vs https, ... etc, and I get the same slow behaviour; 30mins to get to 14MiB? I don't recall it being this bad.

Very frustrated as I get good speeds on general downloads and not sure why it is this slow to clone a repo...

like image 527
Shaun Wilde Avatar asked Apr 17 '19 02:04

Shaun Wilde


People also ask

Is cloning the same as forking?

Forking is a concept while cloning is a process. Forking is just containing a separate copy of the repository and there is no command involved. Cloning is done through the command 'git clone' and it is a process of receiving all the code files to the local machine.

Is cloning same as downloading in GitHub?

When you download the repo it just gives you all the source files with no . git so you dont have the repo. When you clone you get a copy of the history and it is a functional git repo.

What happens when you clone a GitHub repository?

Cloning a repository pulls down a full copy of all the repository data that GitHub.com has at that point in time, including all versions of every file and folder for the project. You can push your changes to the remote repository on GitHub.com, or pull other people's changes from GitHub.com.

Is it safe to clone git repository?

It is safe, however, to run git gc , which uses the --local option by default. If you want to break the dependency of a repository cloned with --shared on its source repository, you can simply run git repack -a to copy all objects from the source repository into a pack in the cloned repository.


1 Answers

Likely a temporary routing issue on the service provider's end, but GitHub has a debug site where you can run a few tests and then send them the outputs for further investigation. The site can be found here:

https://github-debug.com/

like image 100
fernandez Avatar answered Oct 14 '22 16:10

fernandez