因为git默认是不适用代理的,所以即使有用代理,下载速度还是很慢,需要手动设置代理。
根据自己所用代理的网络协议和端口号选择
//所使用的梯子使用的协议是http协议
git config --global http.proxy 127.0.0.1:端口号
git config --global https.proxy 127.0.0.1:端口号
//所用代理使用的协议是socks协议
git config --global http.proxy socks5 127.0.0.1:端口号
git config --global https.proxy socks5 127.0.0.1:端口号
查看和取消代理设置
查看所有配置
git config --global --list
查看http协议代理和https协议代理
git config --global --get http.proxy
git config --global --get https.proxy
取消http代理和https代理
git config --global --unset http.proxy
git config --global --unset https.proxy
当使用Git时,如果默认不配置代理,下载速度可能很慢。可以通过设置HTTP或SOCKS代理来改善这一情况。对于HTTP协议的代理,可以使用命令`gitconfig--globalhttp.proxy127.0.0.1:端口号`和`gitconfig--globalhttps.proxy127.0.0.1:端口号`进行设置。如果是SOCKS协议,应使用`gitconfig--globalhttp.proxysocks5://127.0.0.1:端口号`和`gitconfig--globalhttps.proxysocks5://127.0.0.1:端口号`。要查看或取消代理,可以利用`gitconfig--global--list`,`gitconfig--global--gethttp.proxy`,`gitconfig--global--gethttps.proxy`以及`gitconfig--global--unsethttp.proxy`和`gitconfig--global--unsethttps.proxy`等命令。
3556

被折叠的 条评论
为什么被折叠?



