国内git clone GitHub慢是日常。配代理让Git走SOCKS5能明显提速。
临时配置
git clone -c http.proxy="socks5://代理IP:1080" https://github.com/user/repo.git
全局配置
git config --global http.proxy socks5://代理IP:1080 git config --global https.proxy socks5://代理IP:1080 # 取消 git config --global --unset http.proxy
SSH协议走代理
~/.ssh/config 里配:
Host github.com ProxyCommand nc -X 5 -x 代理IP:1080 %h %p
天行IP(邀请码blsj月付6元起)SOCKS5配Git clone GitHub效果明显。
常见问题
配了还是慢?
看代理到GitHub实际延迟。国内代理到海外延迟本身不低,加速效果看代理线路质量。
免责声明:代码示例仅供学习。






