这两个命令是用来配置 Git 在使用 HTTP 和 HTTPS 协议访问远程仓库时的代理设置。
具体操作如下:
- 打开终端或命令行窗口,输入以下命令来设置 HTTP 代理地址:
git config --global http.proxy <your_proxy_addr>
其中 <your_proxy_addr> 是你所使用的 HTTP 代理服务器的地址和端口号。例如:
git config --global http.proxy http://proxy.example.com:8080
- 输入以下命令来设置 HTTPS 代理地址:
git config --global https.proxy <your_proxy_addr>
其中 <your_proxy_addr> 是你所使用的 HTTPS 代理服务器的地址和端口号。例如:
git config --global https.proxy https://proxy.example.com:8080
- 配置完成后,可以通过以下命令查看已经配置好的代理设置:
git config --global --get-regexp proxy
如果你想要取消已经配置好的代理设置,可以使用以下命令:
git config --global --unset http.proxy
git config --global --unset https.proxy
这样就会将 Git 的代理设置恢复为默认值。




