Git 使用 HTTP 代理

原始记录时间:2024年7月9日

Git 使用 HTTP 代理

设置代理

git config --global http.proxy http://127.0.0.1:2802

停用代理

git config --global --unset http.proxy

补充:以上配置仅影响 HTTP/HTTPS 协议。如需 SSH 协议走代理,需配置 ~/.ssh/config 使用 ProxyCommand。Git 还支持 https.proxy 单独设置 HTTPS 代理。