0%

GitHub 加速

无论是访问GitHub还是用 git 来克隆仓库,由于种种原因,速度都感人的不行,最头疼的是就算开了全局代理,用处似乎也不大。花了一些时间,在网上找到了解决办法。

GitHub网站访问加速

原本只是在 PAC 列表里加上了github.com,后来发现由于GitHub还需要用到githubxxx.com的链接,便又加入 github*.com,速度一下就上来了。

image-20200218224159818

Git 克隆 GitHub 仓库加速

然鹅上述方法对 git 是没用的。首先先找到代理的监听端口,一般都是1080+,我这里是1086。

image-20200218224534060

然后在终端中输入:

1
2
3
4
5
6
7
# socks5协议,1086端口修改成自己的本地代理端口
git config --global http.https://github.com.proxy socks5://127.0.0.1:1086
git config --global https.https://github.com.proxy socks5://127.0.0.1:1086

# http协议,1086端口修改成自己的本地代理端口
git config --global http.https://github.com.proxy https://127.0.0.1:1086
git config --global https.https://github.com.proxy https://127.0.0.1:1086

这样一来,GitHub流量就能走代理了,速度能上1M/s。