首先你需要有代理,比如我用的是ssr那么首先看下端口号是多少


git 设置代理_端口号 image.png

git 设置代理_代理服务器_02 image.png

git设置代理命令是:

// 查看当前代理设置 ,注意:必须有代理服务器
git config --global http.proxy
// 设置当前代理为socket5://127.0.0.1:1080
git config --global http.proxy 'socks5://127.0.0.1:1086'
git config --global https.proxy 'socks5://127.0.0.1:1086' /




// 如果需要删除代理
git config --global --unset https.proxy