两种情况:
配置http代理Windows、Linux、Mac OS中git命令
配置socks5代理
git config --global http.proxy socks5 127.0.0.1:7890
git config --global https.proxy socks5 127.0.0.1:7890
配置http代理
git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890
解读:

socks5和http两种协议由使用的代理软件决定,不同软件对这两种协议的支持有差异,如果不确定可以都尝试一下
主机号和端口号可在代理的位置查看(自己有vpn的需要查看)

查看代理命令
git config --global --get http.proxy
git config --global --get https.proxy
取消代理命令
git config --global --unset http.proxy
git config --global --unset https.proxy