Git设置/取消代理

设置http/https代理

# 设置http代理
git config --global http.proxy IP:Port

# 设置https代理
git config --global https.proxy IP:Port

示例

git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890

如有账户名密码

git config --global http.proxy user:password@127.0.0.1:7890
git config --global https.proxy user:password@127.0.0.1:7890

取消代理设置

# 取消http代理
git config --global --unset http.proxy

# 取消https代理
git config --global --unset https.proxy

查看当前代理配置

# 查看http代理
git config --global --get http.proxy

# 查看https代理
git config --global --get https.proxy
上一篇