用的 clash for Windows ,git 流量默认不走 clash ,可以开个 socket 端口来提供代理,让 push 的流量走 clash
# 设置代理
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
但是上面比较麻烦,每次都要设置。因此需要找个办法让流量强制走 clash ,就是用 clash 的 tun 模式,虚拟张网卡,接管所有流量。下面是 clash for Windows 的文档。
https://docs.cfw.lbyczf.com/contents/tun.html#windows