给sublime安装插件的时候又碰到git clone速度过慢的问题,记录一哈!
打开ss全局代理;
到 IPAddress.com 根据 github.global.ssl.fastly.net 获取github服务器地址;
在 /etc/hosts 或者C:/windows/system32/driver/etc/hosts 文件中添加对应的记录:
ip github.global.ssl.fastly.net
设置git代理:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| # http和https协议代理: git config --global http.proxy http://127.0.0.1:1080 git config --global https.proxy http://127.0.0.1:1080
# sock5的情况 git config --global http.proxy socks5://127.0.0.1:1080 git config --global https.proxy socks5://127.0.0.1:1080
# 取消代理 git config --global unset http.proxy git config --global unset https.proxy
# ssh协议代理:在用户目录下建立如下文件 ~/.ssh/config,对 GitHub 的域名做单独的处理 # 这里必须是 github.com,因为这个跟我们 clone 代码时的链接有关 Host github.com # 如果用默认端口,这里是 github.com,如果想用443端口,这里就是 ssh.github.com 详见 https://help.github.com/articles/using-ssh-over-the-https-port/ HostName github.com User git # 如果是 HTTP 代理,把下面这行取消注释,并把 proxyport 改成自己的 http 代理的端口 ProxyCommand socat - PROXY:127.0.0.1:%h:%p,proxyport=6667 # 如果是 socks5 代理,则把下面这行取消注释,并把 6666 改成自己 socks5 代理的端口 ProxyCommand nc -v -x 127.0.0.1:6666 %h %p
|
==>> 设置 git 代理
在Ubuntu下需要在网络设置里打开网络代理设置代理主机:socks5://127.0.0.1:1080