解决挂着Clash的时候git操作push失败的问题

当开启Clash后,本机网络会被代理,此时可以在 设置-网络-代理 中看到:
在这里插入图片描述

git push 失败的原因就是本机开启了代理,而git没有设置代理,导致443端口转发不过去,此时只需要设置以下git的代理即可解决


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 --unset http.proxy
git config --global --unset https.proxy



查看代理



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