Boost Git Clone Speed in China: Use Gitee to Download at 1‑2 MB/s
This guide explains how Chinese developers can overcome slow GitHub clone speeds by mirroring repositories to Gitee, achieving download rates of 1–2 MB/s and also provides a method to accelerate submodule fetching.
Because of network connections, downloading from GitHub in China is usually limited to about 20 kB/s, which is acceptable for small projects but painfully slow for larger ones with many submodules.
This article proposes a new approach: use Gitee (码云) to mirror GitHub repositories, allowing download speeds of 1–2 MB/s.
1. Use Gitee’s repository mirroring
Requirements: a GitHub account and a Gitee (gitee.com) account.
Steps:
Fork the desired GitHub project to your own GitHub account (instant).
Log in to Gitee (register if needed), click the “Add Project” (+) button, choose “Migrate GitHub project”, link your GitHub account, select the project, and complete the migration (under three minutes).
Clone the repository from Gitee using the Gitee URL; the download speed is measured in MB/s.
Alternatively, you can create a new Gitee repository and set its remote URL directly.
Step 1: Create a new repository
Step 2: Example with GitHub repo https://github.com/PX4/Firmware.git
Step 3: …
Step 4: …
2. Speed up submodule downloads
Some projects use third‑party submodules that are not automatically fetched with git clone. After cloning the main project, run: git submodule update --init --recursive The submodule URLs still point to GitHub, so the same slow speed applies. Apply the mirroring method to each submodule: fork the submodule repository to your GitHub account, migrate it to Gitee, replace the submodule URL with the Gitee link, and then run the update command again.
After updating the URLs, the submodules download at the higher speed.
For detailed step‑by‑step instructions, search online.
References:
https://blog.csdn.net/kcx55/article/details/24400501
https://www.jianshu.com/p/c81e2bd377ad
https://blog.csdn.net/qq_22630169/article/details/74236535Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
