第一步、在网站在网站 https://www.ipaddress.com/ 分别搜索
github.global.ssl.fastly.net
github.com
获取两个地址的IP地址
第二步、配置hosts文件
在终端执行
sudo vim /etc/hosts
通过vim编辑器添加地址如下图:

保存后可以通过cat查看是否添加上
第三步、刷新网络配置
终端执行命令:
dscacheutil -flushcache
执行后重启终端,git clone 速度提升很大从几k每秒到几M每秒的速度

网友评论