GitHub GHClone - 국내 GitHub 가속 스킬
적용 시나리오
사용자가 중국 본토 네트워크 환경에서 다음과 같은 상황을 만나면 활성화합니다:
git clone https://github.com/...느림, 멈춤,Recv failure: 연결이 초기화됨, 타임아웃- GitHub 웹/API 직접 연결 불안정 또는 완전 차단 (
curl https://github.com0바이트) - GitHub 저장소, Release 파일, raw 파일을 대량으로 가져와야 할 때
핵심 아이디어: github.com에 대한 접근을 국내에서 직접 접근 가능한 '가속 프리픽스(mirror proxy)'로 우회하고, 여러 프리픽스를 자동 순환 + 재시도합니다. 하나의 프리픽스가 막혀도 멈추지 않고 다음으로 자동 전환됩니다.
원클릭 설치
# 이 저장소를 클론 (사용 가능한 프리픽스로 먼저 가져오세요)
git clone https://gh-proxy.com/https://github.com/OWNER/github-ghclone.git
cd github-ghclone
bash scripts/install.sh
source ~/.bashrc # ~/bin 활성화
설치 후 얻는 것:
~/bin/ghclone— 실행 스크립트 (3개 프리픽스 자동 순환, 각 프리픽스당 3회 재시도)- git 전역 정적 가속
url."https://gh-proxy.com/https://github.com/".insteadOf(일반git clone도 직접 혜택) - git 별칭
gclone→ghclone
사용법
# 방법 1: 스크립트 직접 호출
ghclone https://github.com/owner/repo.git --depth 1
# 방법 2: git 별칭
git gclone https://github.com/owner/repo.git --depth 1
# 일반 git 명령어 (전역 가속 적용됨, 별칭 불필요)
git clone https://github.com/owner/repo.git
ghclone은 현재 사용 가능한 프리픽스를 자동 탐지하며, 성공하면 반환하고 모두 실패하면 오류를 출력합니다.
수동 설정 (install.sh를 실행하지 않으려는 경우)
- 스크립트 다운로드 (본 저장소
bin/ghclone)를~/bin/에 넣고chmod +x실행. - git 전역 정적 가속 (현재 사용 가능한 프리픽스 중 하나 선택):
git config --global url."https://gh-proxy.com/https://github.com/".insteadOf "https://github.com/" - git 별칭:
git config --global alias.gclone '!~/bin/ghclone' - PATH:
~/bin이PATH에 포함되도록 (~/.bashrc에 추가):export PATH="$HOME/bin:$PATH"
프리픽스 변경 / 추가 및 삭제 (특정 프리픽스가 막혔을 때)
가속 프리픽스는 커뮤니티에서 유지 관리하는 프록시로, 때로는 작동하고 때로는 작동하지 않으므로 순환이 필요합니다:
~/bin/ghclone(또는 본 저장소bin/ghclone) 안의PATS=(...)배열을 수정하여 프리픽스를 추가/삭제합니다.- git 전역 정적 프리픽스 변경:
# 새 사용 가능 프리픽스로 변경 git config --global url."https://새프리픽스/https://github.com/".insteadOf "https://github.com/" # 이전 프리픽스 제거 git config --global --unset url."https://이전프리픽스/https://github.com/".insteadOf
프리픽스 가용성 확인
각 프리픽스에 대해 실제 작은 저장소 탐색을 실행합니다 (커밋 해시 반환 시 사용 가능, 0바이트/오류 시 사용 불가):
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:-사용 불가}"
done
알려진 사용 가능 프리픽스 (2026-10 실측, 수시로 변함)
| 프리픽스 | 사용법 |
|---|---|
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 |
중국 본토에서
github.com에 직접 연결하면 보통 0바이트(차단됨)이므로 반드시 프리픽스를 사용하세요. 프리픽스 서비스는 불안정하므로,ghclone의 재시도 로직은 '연결이 초기화됨'과 같은 일시적 장애를 대비한 것입니다.
한계 및 주의사항
- 프리픽스 프록시는 제3자 커뮤니티 서비스로, 가용성, 속도, 존속 시간을 보장할 수 없습니다. 모두失效할 경우 새 프리픽스를 찾아
PATS를 교체해야 합니다. github.com의 git 프로토콜 접근만 가속합니다.objects.githubusercontent.com(Release 대용량 파일) 등 하위 도메인도 동일하게 프리픽스로 감싸서 사용 가능합니다.- 규정 준수 안내: 현지 법규에 부합하는 출국 방식을 사용하시기 바랍니다.