解决方案一:
参考文章 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加速插件,两者冲突了
更新:
Execute the git command: release ssl verification:
git config --global http.sslVerify "false"
https://github.com/Kong/insomnia/issues/2251
解决方案二(有效!!, 现在都是用这个):
参考文章:
[报错解决] Failed to connect to github.com port 443 after ***** ms: Couldn‘t connect to server-优快云博客
- 科学上网工具
-
查看自己本机系统代理:设置---网络和Internet---代理---地址:端口
-
基于项目根目录修改git配置:(其中的23457改为你电脑的代理端口号,即上面获取的这个端口号)
git config --global http.proxy http://127.0.0.1:23457 git config --global https.proxy https://127.0.0.1:23457
-
刷新缓存:ipconfig /flushdns