Skip to content

GitHub 访问加速与 Git 命令行配置

30 秒快速答案
问题:Git 命令行 clone 代码频繁报错 Failed to connect to github.com 怎么办?
在终端运行 Git 代理命令,将 HTTP 代理指向本地端口:
git config --global http.proxy http://127.0.0.1:7890
或在客户端中直接开启 TUN 虚拟网卡模式

💻 常用 Git 代理配置命令

bash
# 设置 HTTP / HTTPS 代理 (以本地端口 7890 为例)
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890

# 若需取消 Git 全局代理
git config --global --unset http.proxy
git config --global --unset https.proxy
针对当前知识点的精选服务商推荐

光速云 (GuangSuCloud) 🏆 2026 全站总榜 No.1 · 旗舰主推

2020老牌企业级 IEPL 物理专线与 VLESS 协议 | 晚高峰 0 丢包 | 自研与全平台客户端一键导入

起步月付: ¥17/月线路: IEPL晚高峰: S+

围绕网络工具、代理协议与线路知识的独立中文百科