Boost Git Clone Speed in China with Gitee: Get 1‑2 MB/s Downloads
This guide explains how to overcome the typical 20 kB/s GitHub download limit in China by mirroring repositories to Gitee, providing step‑by‑step instructions to achieve 1‑2 MB/s clone speeds for both main projects and their submodules.
Because GitHub download speeds in China are often limited to about 20 kB/s, large projects with many submodules can take an excessive amount of time to clone. This article shows how to use Gitee (码云) to mirror repositories and achieve download rates of 1‑2 MB/s.
Using Gitee to Mirror a GitHub Repository
Fork the desired GitHub repository to your own GitHub account.
Log in to Gitee (register if you don’t have an account), click the “Add Project” button, choose the “Migrate GitHub Project” option, link your GitHub account, and select the forked repository to import.
Clone the imported repository from Gitee using the Gitee URL; the download speed is typically measured in megabytes per second.
These steps eliminate the need to keep a terminal running overnight for large clones.
Accelerating Submodule Downloads
When a project contains submodules, the command git submodule update --init --recursive still fetches them from their original GitHub URLs, which remain slow. To speed up submodule cloning, repeat the mirroring process for each submodule:
Identify the URLs of the submodules used by the cloned project.
Fork each submodule repository to your GitHub account.
Import each forked submodule into Gitee using the same “Migrate GitHub Project” workflow.
Replace the submodule URLs in the main project’s .gitmodules file with the corresponding Gitee URLs.
Run git submodule update --init --recursive again; the submodules will now be downloaded from Gitee at high speed.
Following these steps significantly reduces clone time for both the main repository and its submodules.
Signed-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.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
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.
