SOCKS5 代理配置
对于 SOCKS5 代理(假设代理地址为 127.0.0.1,端口为 7890),运行以下命令:
git config --global http.proxy 'socks5://127.0.0.1:7890'
git config --global https.proxy 'socks5://127.0.0.1:7890'
HTTP 代理配置
若使用 HTTP 代理(假设代理地址为 127.0.0.1,端口为 7890),运行以下命令:
git config --global http.proxy 'http://127.0.0.1:7890'
git config --global https.proxy 'http://127.0.0.1:7890'
验证代理配置
执行以下命令检查当前代理设置是否生效:
git config --global --get http.proxy
git config --global --get https.proxy
取消代理配置
如需取消代理设置,使用以下命令清除配置:
git config --global --unset http.proxy
git config --global --unset https.proxy
如果要使用docker,可以使用host模式

2712

被折叠的 条评论
为什么被折叠?



