Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to improve the download speed of github

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will give you a detailed explanation on how to improve the download speed of github. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

In China, the peak speed of downloading code from github is usually 20kB/s. This speed is fine for small projects, while for larger projects with many sub-modules, it is a waste of time. The common method is to modify HOST or hang VPN, which is not stable in practice.

Here is a new way to download at 1~2MB/s speed.

1. Use the code warehouse provided by open source China

The title has been made very clear, and I think people who often use git probably already know it. For those who are new to git, maybe you only know github.

In fact, there are many code warehouse providers at home, and not only github abroad. It's just that the country is just beginning, and there are not many people who pay attention to it.

The code warehouse provided by Open Source China provides a function, that is, it can clone the code from the github account to the account in Open Source China. This code warehouse is called code cloud, yes, it is code cloud.

You are required to have a github account and a Cloud gitee account.

The steps are simple.

1. First of all, frok the projects you want to work on github to your own github account. Time-consuming: in an instant

two。 Log in to gitee and register yourself if you don't have it. There is a button to add items on the page, a plus sign. Click the plus sign, the drop-down list has the option of migrating github projects, click on it and follow the prompts to associate your github account, then select the project you want to migrate and follow the prompts. Time: less than three minutes.

3. According to the clone github project method, clone migrates to the project in the gitee account. The difference is that the clone link is replaced by the link to the target project in gitee. Usually the download speed is measured in MB/s.

According to the above method, basically no longer need to hang up all night clone code.

Recently re-looked, in fact, the above steps are somewhat cumbersome, it can be simpler, the new warehouse directly set the remote warehouse address.

Step 1: build a new warehouse

.

Step 2: take github warehouse https://github.com/PX4/Firmware.git as an example

Step 3:

The fourth step

two。 Increase the speed of downloading submodules

Third-party code repositories are used in some projects, but these sub-modules submodule are not automatically downloaded when you use the clone instruction, because they are stored in a different address. You need to execute the clone after completing the target project.

Git submodule update-init-recursive

The dependent submodules required by the target project will be downloaded. The submodules used in the github project are still placed on github. This is tragic, which means that you still have to deal with the speed of the above 20KB/s after executing the above instructions. Although it will not be shown at this time, it is still a long time to wait.

We also use the above ideas to speed up clone.

Find the link to the submodule it uses from the downloaded project.

Open the link in the previous step, frok the code of the target sub-module used to your own github account, and then migrate the same method to gitee. If there are multiple sub-modules, repeat the operation several times, the same routine.

Change the link address of the submodule module used by the original project to the address after the sub-module is migrated to gitee.

Then execute git submodule update-- init-- recursive.

This is the end of this article on "how to improve the download speed of github". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report