网络问题导致的github提交失败解决方案

解决方案一:

参考文章 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-CSDN博客

  1. 科学上网工具
  2. 查看自己本机系统代理:设置---网络和Internet---代理---地址:端口

  3. 基于项目根目录修改git配置:(其中的23457改为你电脑的代理端口号,即上面获取的这个端口号)

    git config --global http.proxy http://127.0.0.1:23457 	
    git config --global https.proxy https://127.0.0.1:23457 	
  4. 刷新缓存:ipconfig /flushdns

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值