解决 github 网站 git push 或者 git clone 代码速度太慢

文章目录

  • 解决 github 网站 git push 或者 git clone 代码速度太慢
      • 1、获取 global.ssl.fastly 地址
      • 2、获取 global.ssl.fastly 地址
      • 3、修改 hosts 映射
      • 4、刷新系统 DNS


解决 github 网站 git push 或者 git clone 代码速度太慢

工作中往往需要从 github 上 clone 别人的代码或者 Push 代码,如果特别慢或者根本连接不上!有个修改 hosts 的方法,不完全保证,可以试试!

1、获取 global.ssl.fastly 地址

访问 http://github.global.ssl.fastly.net.ipaddress.com/#ipinfo,获取 cdn 域名以及 IP Address

2、获取 global.ssl.fastly 地址

访问 http://github.com.ipaddress.com/#ipinfo,获取 cdn 域名以及 IP Address

3、修改 hosts 映射

  // Windows路径:
  C:\Windows\System32\drivers\etc\hosts
  // 文件末尾添加
  #github related website
  199.232.69.194 http://github.global.ssl.fastly.net
  140.82.113.4 http://github.com

  // Linux环境:
  sudo vim /etc/hosts
  #github related website
  199.232.69.194 http://github.global.ssl.fastly.net
  140.82.113.4 http://github.com

4、刷新系统 DNS

  // Windows执行命令:
  ipconfig /flushdns

  // Linux执行命令
  /etc/init.d/networking restart

你可能感兴趣的:(github,git)