Completely solve the problem of slow GitHub pulling code network speed

I rely heavily on GitHub and program for GitHub. GitHub allows me to turn on my computer every morning and pretend to learn about the latest open source projects.

Have you noticed recently that GitHub is significantly slower? If there is no fanqiang, the speed of pulling code is terrible. If the amount of pull is small, it can be pulled down barely, but when the amount of data is large, 2 KiB/s Can you bear the speed? Pulling to the midway overtime will make you unhappy.

I encountered this problem recently. The seata.github.io warehouse of the seata community has suddenly added a lot of data for a while, and I found that I can’t pull it down anymore. At this time, I can use Gitee as an intermediate agent. Let’s talk about the specific operation process in detail. .

In GitHub, there are two repositories:

  1. seata : Github's main Seata repository is: https://github.com/seata/seata.github.io.git
  2. objcoding : I fork a warehouse from the Seata main warehouse, the address is: https://github.com/objcoding/seata.github.io.git

The following content will use seat and objcoding to represent these two warehouses.

When Gitee creates a warehouse, you can choose to import from the GitHub warehouse when importing an existing warehouse. At this time, we fill in the address of the Seata main warehouse, which means that the Gitee warehouse will be able to synchronize code from the Seata main warehouse:

Completely solve the problem of slow GitHub pulling code network speed

 

Clone the Gitee warehouse to the local (the warehouse name defaults to origin at this time):

git clone https://gitee.com/objcoding/seata.github.io.git

 

Completely solve the problem of slow GitHub pulling code network speed

 

This speed is so fast that I want to cry, can you imagine the miserable life of GitHub 2 KiB/s.

Add objcoding remote warehouse:

git remote add objcoding https://github.com/objcoding/seata.github.io.git

fetch objcoding remote warehouse content to local:

Completely solve the problem of slow GitHub pulling code network speed

 

The speed is very fast, because most of the code in the remote warehouse has been pulled from gitee.

Add seata remote warehouse:

git remote add seata https://github.com/seata/seata.github.io.git

Similarly, fetch seata remote warehouse content to local.

At this time, my local warehouse has three remote warehouses, namely:

  1. origin: Code cloud warehouse, which can synchronize code from seata warehouse;
  2. objcoding: the warehouse fork from the seata warehouse;
  3. seata: seata main warehouse.

Why do we need to add seata warehouse here? This is because generally speaking, the amount of code data added to the seata main warehouse is very small, even at a speed of 2Kib/s, it can be pulled down, so you can usually pull the latest code directly from the seata main warehouse. , But like the seata.github.io warehouse, suddenly a big guy uploads tens of megabytes of data, then I can use the Gitee warehouse to synchronize these codes, the specific operations are as follows:

Completely solve the problem of slow GitHub pulling code network speed

 

Next, the corresponding branch of fetch gitee can pull down the data.

Completely solve the problem of slow GitHub pulling code network speed

 

The above is the analysis of the entire synchronization process.

Reprinted at: https://mp.weixin.qq.com/s/OTJ105LLvCQmC-21oomvCA

Guess you like

Origin blog.csdn.net/qq_45401061/article/details/108761413