参考链接: https://gist.github.com/fearb…很多时候我们在使用 github 的时候会出现下载很慢的情况。如果你有代理,可以直接设置代理,来获取更快下载和上传资源的速度。给 git 设置 SOCKS5 代理:使用 https 的时候,就是使用 https 协议复制仓库的时候如: https://github.com/KyleBing/T...git config –global http.proxy ‘socks5://127.0.0.1:1080’git config –global https.proxy ‘socks5://127.0.0.1:1080’也可以直接修改用户主目录下的 .gitconfig 文件[http] proxy = socks5://127.0.0.1:1080[https] proxy = socks5://127.0.0.1:1080在使用 git 开头的路径时,也就是在使用 ssh 通道时如: git@github.com:KyleBing/TouchbarBBT.git打开用户主目录下的 .ssh/config 文件,添加以下内容ProxyCommand nc -x localhost:1080 %h %p效果,速度是真快之前的速度:之后的速度:言外terminal 中设置临时代理直接执行export ALL_PROXY=socks5://127.0.0.1:1080或者在用户主目录下的 .bash_profile 添加别名,这样以后在使用的时候就可以直接输入 proxy了alias proxy=“export ALL_PROXY=socks5://127.0.0.1:1080”