Mac环境git clone提速

  • 安装connect工具
brew install connect
  • 修改https方式git clone配置 (需根据ss代理端口号而定!)
vim ~/.gitconfig

[http]
    postBuffer = 524288000
    proxy = socks5://127.0.0.1:1086
[https]
    proxy = socks5://127.0.0.1:1086

或者用命令行修改配置

git config --global http.proxy 'socks5://127.0.0.1:1086'
git config --global https.proxy 'socks5://127.0.0.1:1086'
  • 修改ssh方式git clone配置
vim ~/.ssh/config

Host github.com
 ProxyCommand connect -S 127.0.0.1:1086 %h %p

 

  • 参考文章

https://hacpai.com/article/1532917254202

https://www.hi-linux.com/posts/11850.html?utm_source=hacpai.com

https://gist.github.com/chuyik/02d0d37a49edc162546441092efae6a1?utm_source=hacpai.com

https://bitbucket.org/gotoh/connect/wiki/Home?utm_source=hacpai.com

 

你可能感兴趣的:(Mac环境git clone提速)