Alaya NeW Cloud

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 (transformers from source, peft repo, 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.

MirrorAddressForm
GH-Proxyhttps://ghproxy.com or https://ghproxy.netURL prefix proxy
Akamshttps://github.akams.cnWeb download UI
LLKKhttps://gh.llkk.ccURL prefix proxy
GitMirrorhttps://hub.gitmirror.comURL 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/vllm

wget release

wget https://ghproxy.com/https://github.com/microsoft/vscode/archive/refs/tags/1.82.3.zip

curl release

curl -LO https://ghproxy.com/https://github.com/github/gh-ost/releases/download/v1.1.6/gh-ost

Download a raw file

curl https://ghproxy.com/https://raw.githubusercontent.com/microsoft/vscode/main/LICENSE.txt

Supported 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/".insteadOf

insteadOf 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/peft

Pre-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/".insteadOf

The 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:

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.com

Use 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 download through 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 insteadOf for 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

Was this page helpful?

On this page