A sore point

As we all know, GitHub is a huge repository of open source and a gathering place for programmers and hobbyists, including many of the best open source projects I’ve recommended.

However, whenever we see a good open source project, ready to ** (bai) load (PIAO) **, we will find that the speed of Git Clone is unusually slow! Personally, in my 200M mobile broadband environment at home, I can’t find a time when I clone the open source project faster than 20.00 KiB/s, which is pretty uncomfortable.

Small projects are fine. I can wait a few minutes. Git Clone is likely to fail if the project becomes too large or the number of files in the project increases.

Of course, online common methods such as modifying hosts and proxy are not always effective and unstable.


The “code cloud” is a good thing

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

Thank you ioc for your advice

(1) First of all, ensure that there is an account on the code cloud, which can be used normally.

(2) Click the plus sign on the upper right corner of the new warehouse+, select FromGitHub/GitLabImport warehouse menu

(3) Then fill in the locationGitHubYou want tocloneWarehouse address and import

This step to code cloud to do speed is very fast, in a short time, code cloud cloned a GitHub exactly the same project!

(4) Next, we put the project through the project address on the code cloudcloneTo the local, this time the clone speed is very fast, severalMB/sThe speed was fine, and soon the project was downloaded.

By this time our aim has been achieved, logically, but let’s not forget that there is one thing left to do.


Re-associate the remote address

Remember, at this point, the project cloned locally is associated with the address of the code cloud Gitee, has been completely separated from the original GitHub project, is another copy.

When necessary (such as when we are giving PR to a project on GitHub), we also need to re-associate our local project with the original GitHub project as follows:

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

(2) Open it with a text editor.gitIn folderconfigThe configuration file

Reassociate the [remote “Origin “].url field in the configuration file with the GitHub project address originally located on GitHub

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

Now that you’re done, the local project is pretty much a clone from GitHub, with no problems with code and PR.