GitHub download acceleration

A pain point

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

But whenever we see a good open source project, ready to go down (bai) load (piao) time, you will find git clonethe speed of abnormal slow! For me personally, in my home environment for mobile broadband 200M, I clone open source projects have not been found faster than 20.00KiB/swhen it is simply too uncomfortable.

It's fine for small projects, I don't care if I wait a few minutes; once the project is huge, or the number of project files is over, there is a git clonehigh probability of failure!

Of course, the actual use of common methods such as modifying hosts and agents on the Internet is not necessarily good, and it is also unstable.


"Code Cloud" is a good thing

Next, I will introduce a method of accelerating GitHub download: through the transfer of the domestic code cloud platform , to complete the download acceleration of the project on GitHub.

Thanks to the public account ioc for providing ideas

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

(2) Click the plus sign new warehouse top right corner +, select "from the GitHub/GitLabimport warehouse" menu

(3) Then fill located GitHubon you want to cloneaddress of the warehouse and import

This step is very fast for Code Cloud to do . After a while, Code Cloud cloned a project exactly like GitHub!

(4) Next we address through a project code on the cloud, the project cloneto a local, this time the clone speed very quickly, a few MB/sspeed is no problem, just download the program quickly.

It stands to reason that our goal has been achieved at this time, but don't forget that there is one more thing that has not been done.

 

Reassociate remote address

You should know that the cloned local project at this time is associated with the code cloud Gitee's address, which has been completely separated from the original GitHub project and is another copy .

When necessary (for example, we want to mention a project on GitHub PR), we also need to re-associate our local project to the original GitHub project, as follows:

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

(2) Open a text editor .gitfolder configprofile

The configuration file [remote"origin"].urlback to the original field associated with the address located on GitHub GitHub project

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

At this point you're done, the local project is the equivalent of clonefrom GitHub, subsequent to mention the code, put PRto no problem on GitHub.

Published 117 original articles · 69 praises · 10,000+ views

Guess you like

Origin blog.csdn.net/zsd0819qwq/article/details/105339568