GitHub download speed up!

Time:2020-11-20

GitHub download speed up!


A pain point

As we all know, GitHub is a huge open source repository, and a gathering place for programmers and programming enthusiasts, including many excellent open source projects I recommended before, all of which are located on GitHub.

But whenever we see good open source projects, we are ready to goNext (BAI) load (Piao)You will find thatgit cloneIs extremely slow! As far as I’m concerned, in my family’s 200m mobile broadband environment, I haven’t found that the speed of cloning open source projects is faster than that20.00 KiB/sIt’s really hard.

GitHub download speed up!

It’s OK for small projects. I don’t care if I wait for a few minutes. Once the project becomes large or the number of project files increases,git cloneMaybe the rate will fail!

Of course, the commonly used methods such as modifying hosts and agents on the Internet are not necessarily good and unstable.


Code cloud is a good thing

Next, we introduce a method to speed up GitHub Download: through the domesticCode cloud platformTo complete the download acceleration of GitHub project.

Thank you for your ideas

(1) First of all, make sure that there is an account on the code cloud, which can be used normally. If not, you can register by yourself.

(2) Click the plus sign of new warehouse in the upper right corner+, select “fromGitHub/GitLabImport warehouse menu

GitHub download speed up!

(3) Then fill in theGitHubWhat do you thinkcloneWarehouse address and import

GitHub download speed up!

This stepGive it to code cloudAs like as two peas, the speed is very fast. In a moment, the code cloud cloned a project that was exactly the same as GitHub.

GitHub download speed up!

(4) Next, we will use the project address on the code cloud to change the projectcloneWhen you get to the local area, the speed of the clone is very fastMB/sThe speed of the project is no problem. The project will be downloaded soon.

GitHub download speed up!

Logically speaking, our goal has been achieved by this time, but don’t forget that there is still one thing we haven’t done.


Re associate remote address

You should know that the project cloned to the local is associated with the address of gitee, which is already connected with the original GitHub projectCompletely detachedIt’s another onecopy

If necessary (for example, we are going to give a project on GitHubPR), we also need to re associate our local project with the original GitHub project, as follows:

(1) First find the hidden folder under the local warehouse directory.git

GitHub download speed up!

(2) Open with text editor.gitIn folderconfigconfiguration file

GitHub download speed up!

Set the[remote "origin"].urlThe field is reassociated to the GitHub project address that was originally located on GitHub

GitHub download speed up!

Of course, you can also modify the remote address through the command line, the effect is the same

At this point, the local project is quite successfulcloneFrom GitHub, the following code is raised, andPRThere’s no problem with GitHub.