本文最后更新于:4 个月前

经常要clone github中的一些项目,无奈如果不爬梯子的话速度实在是龟速,经常1k/s,于是献上改Hosts大法。

第一步:打开http://codeload.github.com.ipaddress.com/#ipinfo 找到你浏览器上实际显示的IP地址, 例图 :

3VCXo6.png

第二步:按win+r唤起运行框,输入cmd,然后再依次ping一下上面的地址

3VPJYT.png

第三步:打开你C:\Windows\System32\drivers\etc\hosts文件,在文件末尾追加如下一行即可

140.82.113.9	http://codeload.github.com

另外以下这些github hosts,可能对你所在地区来说不是最优版本,最优hosts的选择可以参考上面三个步骤

# GitHub Start
192.30.253.112 github.com
192.30.253.119 gist.github.com
151.101.100.133 assets-cdn.github.com
151.101.100.133 raw.githubusercontent.com
151.101.100.133 gist.githubusercontent.com
151.101.100.133 cloud.githubusercontent.com
151.101.100.133 camo.githubusercontent.com
151.101.100.133 avatars0.githubusercontent.com
151.101.100.133 avatars1.githubusercontent.com
151.101.100.133 avatars2.githubusercontent.com
151.101.100.133 avatars3.githubusercontent.com
151.101.100.133 avatars4.githubusercontent.com
151.101.100.133 avatars5.githubusercontent.com
151.101.100.133 avatars6.githubusercontent.com
151.101.100.133 avatars7.githubusercontent.com
151.101.100.133 avatars8.githubusercontent.com
# GitHub End

 目录