1 Star 0 Fork 1K

卡兹莫丹 / apollo

forked from ApolloAuto / apollo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
how_to_solve_slow_pull_from_cn.md 689 Bytes
一键复制 编辑 原始数据 按行查看 历史

国内环境 GitHub 拉取仓库速度慢的缓解方案

第一步: 浏览器打开如下两个网址,找到对应 IP 地址:

  1. http://github.com.ipaddress.com/
  2. http://github.global.ssl.fastly.net.ipaddress.com/

假设对应 IP 地址分别为 140.82.xx.xxx 和 199.232.yy.yyy

第二步: 编辑 hosts 文件

sudo vim /etc/hosts

加入如下两行:

140.82.xx.xxx  github.com
199.232.yy.yyy github.global.ssl.fastly.net

第三步:更新 DNS 缓存(仅限 Mac 用户)

Linux 用户请忽略此步骤。

sudo dscacheutil -flushcache

大功告成!

现在,您可以尝试从 GitHub 重新拉取代码了,是不是变快了一些?

C
1
https://gitee.com/khazmodan/apolloauto.git
git@gitee.com:khazmodan/apolloauto.git
khazmodan
apolloauto
apollo
master

搜索帮助