GitHub GHClone - GitHub Acceleration Skill for China
Use Cases
Enable this skill when users encounter the following issues within China's network:
git clone https://github.com/...is slow, hangs, showsRecv failure: Connection reset by peer, or times out- Direct access to GitHub website / API is unstable or completely blocked (
curl https://github.comreturns 0 bytes) - Need to batch clone GitHub repositories, download Release files, or raw files
Core idea: redirect access to github.com through domestically reachable acceleration prefixes (mirror proxies), and perform automatic rotation + retry across multiple prefixes. If a single prefix hangs, the process doesn't freeze; it automatically switches to the next one.
One-Click Installation
# Clone this repository (you can also clone it using an available prefix)
git clone https://gh-proxy.com/https://github.com/OWNER/github-ghclone.git
cd github-ghclone
bash scripts/install.sh
source ~/.bashrc # make ~/bin effective
After installation you get:
~/bin/ghclone— executable script (auto-rotates 3 prefixes, 3 retries per prefix)- Global git static acceleration
url."https://gh-proxy.com/https://github.com/".insteadOf(so regulargit clonebenefits immediately) - Git alias
gclone→ghclone
Usage
# Method 1: Direct script call
ghclone https://github.com/owner/repo.git --depth 1
# Method 2: Git alias
git gclone https://github.com/owner/repo.git --depth 1
# Regular git command (already globally accelerated, no alias needed)
git clone https://github.com/owner/repo.git
ghclone automatically detects which prefix is currently available. If successful, it returns; only if all fail does it report an error.
Manual Configuration (if you don't want to run install.sh)
- Download the script (the repository's
bin/ghclone), put it in~/bin/andchmod +x. - Global git static acceleration (choose one currently available prefix):
git config --global url."https://gh-proxy.com/https://github.com/".insteadOf "https://github.com/" - Git alias:
git config --global alias.gclone '!~/bin/ghclone' - PATH: ensure
~/binis in yourPATH(append to~/.bashrc):export PATH="$HOME/bin:$PATH"
Changing / Adding / Removing Prefixes (when a prefix hangs)
Acceleration prefixes are community-maintained proxies, available intermittently, so rotation is necessary:
- Edit the
PATS=(...)array in~/bin/ghclone(or the repository'sbin/ghclone) to add or remove prefixes. - Change the global git static prefix:
# Replace with a new available prefix git config --global url."https://new-prefix/https://github.com/".insteadOf "https://github.com/" # Clear the old prefix git config --global --unset url."https://old-prefix/https://github.com/".insteadOf
Verifying Prefix Availability
Test each prefix against a small real repository (returns a commit hash if available, 0 bytes/error if unavailable):
for p in https://gh-proxy.com https://ghfast.top https://ghproxy.net; do
n=$(git ls-remote "$p/https://github.com/octocat/Hello-World.git" HEAD 2>/dev/null | head -1)
echo "$p -> ${n:-unavailable}"
done
Known Available Prefixes (tested Oct 2026, subject to change)
| Prefix | Usage |
|---|---|
https://gh-proxy.com | https://gh-proxy.com/https://github.com/owner/repo.git |
https://ghfast.top | https://ghfast.top/https://github.com/owner/repo.git |
https://ghproxy.net | https://ghproxy.net/https://github.com/owner/repo.git |
Direct access to
github.comin China typically returns 0 bytes (blocked) — always use prefixes. Prefix services are unstable;ghclone's retry logic is designed precisely to handle transient failures like "Connection reset by peer".
Limitations & Notes
- Prefix proxies are third-party community services; their availability, speed, and lifespan are not guaranteed. If all fail, you need to find new prefixes and update the
PATSarray. - Only accelerates
github.comgit protocol access; subdomains likeobjects.githubusercontent.com(for large Release files) can also be wrapped via prefixes. - Compliance note: ensure you use egress methods that comply with local regulations.