GitHub access acceleration (China)
Community proxies to make GitHub usable inside pods running in Mainland China — git clone / wget / curl / git config / pip install
This guide is specific to Mainland China network conditions where direct access to github.com is often slow or interrupted. If you are outside Mainland China, you do not need any of this — use GitHub directly.
Why this matters
From inside Mainland China, raw GitHub access frequently times out or stalls. This breaks:
- Pulling training frameworks (
vLLM,SGLang,llama.cpp,DeepSpeed,LLaMA-Factory, …) - Downloading release artifacts (model weights, wheel packages, binaries)
- pip / npm dependencies that include
git+https://github.com/...references - HuggingFace toolchain pieces that pull GitHub sources (
transformersfrom source,peftrepo, etc.)
This page lists the common ways to make GitHub usable from a pod running in a Mainland China region.
The mirrors listed below are community-maintained public proxies, not GitHub services. They may change domains or shut down at any time. Probe with curl -I before depending on one, and never proxy private-repo clones or token-bearing requests through a third-party — credentials may leak.
Public acceleration mirrors
Pick whichever currently responds. If one dies, try the next.
| Mirror | Address | Form |
|---|---|---|
| GH-Proxy | https://ghproxy.com or https://ghproxy.net | URL prefix proxy |
| Akams | https://github.akams.cn | Web download UI |
| LLKK | https://gh.llkk.cc | URL prefix proxy |
| GitMirror | https://hub.gitmirror.com | URL prefix proxy |
A "URL prefix proxy" works by rewriting https://github.com/... to https://<mirror>/https://github.com/.... Every command-line tool that takes a URL accepts this form.
Terminal usage
Examples below use https://ghproxy.com. Substitute another prefix proxy if needed.
git clone
git clone https://ghproxy.com/https://github.com/vllm-project/vllmwget release
wget https://ghproxy.com/https://github.com/microsoft/vscode/archive/refs/tags/1.82.3.zipcurl release
curl -LO https://ghproxy.com/https://github.com/github/gh-ost/releases/download/v1.1.6/gh-ostDownload a raw file
curl https://ghproxy.com/https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txtSupported URL shapes:
- Raw file:
https://raw.githubusercontent.com/<owner>/<repo>/<branch>/<file> - Branch source:
https://github.com/<owner>/<repo>/archive/refs/heads/<branch>.zip - Release file:
https://github.com/<owner>/<repo>/releases/download/<tag>/<file> - Release source:
https://github.com/<owner>/<repo>/archive/refs/tags/<tag>.zip
Whole-folder offline download is not supported — for that, git clone and tar locally.
Route every git command through the proxy (persistent)
git config rewrites github.com globally, so subsequent git clone / git submodule update automatically use the proxy:
# Enable globally
git config --global url."https://ghproxy.com/https://github.com/".insteadOf "https://github.com/"
# Remove
git config --global --unset url."https://ghproxy.com/https://github.com/".insteadOfinsteadOf is built into git and only affects anonymous HTTPS clones of public repos. SSH (git@github.com:...) and private-repo requests with credentials do not match this rule, so there is no leak risk.
pip install git+ via the proxy
Many Python packages ship installation commands like pip install git+https://github.com/.... With the global git config above, pip will automatically pick up the proxy without any command change.
For a one-shot install:
pip install git+https://ghproxy.com/https://github.com/huggingface/peftPre-bake the proxy in a Dockerfile
Pulling GitHub during image builds is the highest-pain spot. Bake git config into the build stage so it only affects the build:
RUN git config --global url."https://ghproxy.com/https://github.com/".insteadOf "https://github.com/" \
&& git clone https://github.com/vllm-project/vllm.git \
&& git config --global --unset url."https://ghproxy.com/https://github.com/".insteadOfThe runtime container starts without the rewrite, so production code talks to GitHub directly.
Pair with the HuggingFace mirror
If you are pulling both GitHub source and HF model weights, enable each acceleration separately:
- GitHub source → the
ghproxy-style proxy on this page - HuggingFace weights →
HF_ENDPOINTregional mirror
They are independent and do not interfere.
When mirrors are down
Public proxies have no SLA and degrade under load. Diagnostic order:
# 1. Check if direct GitHub is actually broken (sometimes it works fine)
curl -I --max-time 10 https://github.com
# 2. Probe each proxy
curl -I --max-time 10 https://ghproxy.com
curl -I --max-time 10 https://gh.llkk.cc
curl -I --max-time 10 https://hub.gitmirror.comUse whichever returns 200/30x and update the URL in git config.
If all public proxies are down, fallbacks:
- Self-host gh-proxy on your own overseas VPS or IDC
- Fork the repo to Gitee and clone
https://gitee.com/<your>/<repo> - Pull model weights via
huggingface-cli downloadthrough the HF mirror, bypassing GitHub entirely
Caveats summary
- Third-party proxies are community-run public infrastructure. Never proxy private repos or token-bearing requests.
- Proxying is only safe for public repositories.
- Mirror domains are unstable. Avoid hardcoding them in scripts — use
git config insteadOffor centralized switching. - Proxy speed varies by time of day; daytime / weekends are typically slower.
- SSH (
git@github.com:) uses port 22 and is generally not accepted by these proxies. For SSH, set up your own outbound tunnel.
Last updated on
Accelerate model downloads (Hugging Face mirror)
Set HF_ENDPOINT inside a pod to use the internal Beijing-1/2/3/4 mirror — three approaches with snapshot_download, huggingface-cli, and from_pretrained
Install kubectl
Install kubectl on macOS / Linux x86-64 / Windows PowerShell — covers both the official Kubernetes endpoint and the Rancher China mirror
