现象:
国内从github clone或pull时速度很慢,容易超时被服务器掐断链接
github.com 域名对应的ip经常变化,如果隔一段时间之后发现git又变慢了则需重新查询再按以下步骤配置
解决方法:
-
访问https://www.ipaddress.com/
分别查询 github.com 和 github.global.ssl.fastly.net 的IP地址
-
在hosts文件[ C:\Windows\System32\drivers\etc\hosts ]中添加如下内容
140.82.112.4 github.com 199.232.5.194 github.global.ssl.fastly.net
-
cmd命令行刷新DNS(windows平台)
ipconfig/flushdns