git配置代理

找端口

先找到你的代理的端口,我的端口如下:
Pasted image 20260627165849.png

设置代理

打开powershell,输入如下命令:

git config --global http.proxy "http://127.0.0.1:7897"
git config --global https.proxy "http://127.0.0.1:7897"

如果端口号不同记得修改成你的端口号。

查看代理

git config --global --get http.proxy
git config --global --get https.proxy

取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy

完结

标签: 代理

添加新评论