参考文章 github push过程中的timeout问题 | 码农家园
1,打开 C:\Windows\System32\drivers\etc 下的hosts文件
2,
访问 github.global.ssl.Fastly.net Server Report: Analysis of Speed, Location, and DNS Records
记录IP Address x.x.x.x
在hosts文件末尾添加
x.x.x.x github.global.ssl.fastly.net
3,
http://github.com.ipaddress.com/#ipinfo(注意:这个网站国内ip下打不开,翻墙将ip设置海外才能打开)
记录IP Address x.x.x.x
在hosts文件末尾添加
x.x.x.x github.com
保存hosts文件
终端输入:
ipconfig /flushdns
测试连接github:
ping github.com
这时候提交github就不会出现网络问题。
注意:
1,ip需要实时更新的
2,如果要打开github网站,要将以上设置屏蔽掉,不然打不开,可能是因为我浏览器也安装了github加速插件,两者冲突了