git clone 时Failed to connect to github.com port 443:connection timed out 怎么办

这篇具有很好参考价值的文章主要介绍了git clone 时Failed to connect to github.com port 443:connection timed out 怎么办。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

第一种办法:设置全局代理

设置全局代理:

git config --global http.proxy http://127.0.0.1:1080
 
git config --global https.proxy http://127.0.0.1:1080

再次尝试,一般情况下可以正常clone。

如果遇到以下报错:

 Failed to connect to 127.0.0.1 port 1080 after 2070 ms: Connection refused

请采取第二种方法。

第二种方法:修改hosts文件(以windows系统为例)

1.打开https://github.com.ipaddress.com/ 如下图:

git clone 时Failed to connect to github.com port 443:connection timed out 怎么办,git,github

 记录IP地址(可能与上图有差异)!

2.打开https://fastly.net.ipaddress.com/github.global.ssl.fastly.net#ipinfo 如下图:

git clone 时Failed to connect to github.com port 443:connection timed out 怎么办,git,github

 git clone 时Failed to connect to github.com port 443:connection timed out 怎么办,git,github

记录4个IPV4地址!

3.修改hosts文件

windows的hosts文件在C:\Windows\System32\drivers\etc\文件夹下,

在hosts文件夹中添加刚才复制的ip,格式如下:

git clone 时Failed to connect to github.com port 443:connection timed out 怎么办,git,github

如果遇到访问权限的问题,遵守以下方法操作即可修改权限: 

git clone 时Failed to connect to github.com port 443:connection timed out 怎么办,git,github

修改完权限后,需要刷新dns,cmd命令如下(需要进入管理员模式!):

#刷新DNS缓存
ipconfig /flushdns

#展示DNS缓存
ipconfig /displaydns

大功告成!,愉快的进行git clone吧!

git clone 时Failed to connect to github.com port 443:connection timed out 怎么办,git,github

 文章来源地址https://www.toymoban.com/news/detail-572016.html

到了这里,关于git clone 时Failed to connect to github.com port 443:connection timed out 怎么办的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • github clone Failed to connect to github.com port 443 after xxx ms

    最近克隆github项目时老是报超时,可以尝试以下解决方法 如果本地开启了代理还是clone超时,可以尝试最后一种方式解决 1、把 https 换成 http,如: 2、更新本地hosts配置,可以参考这篇文章获取最新的hosts 解决github图片及网页加载不出来 3、 将通信协议由 http/2 改为 http/1.1 改

    2024年01月19日
    浏览(31)
  • linux git clone出现fatal: unable to access Failed to connect to github.com port 443: Timed out解决方案

      大家好,我是herosunly。985院校硕士毕业,现担任算法研究员一职,热衷于机器学习算法研究与应用。曾获得阿里云天池比赛第一名,CCF比赛第二名,科大讯飞比赛第三名。拥有多项发明专利。对机器学习和深度学习拥有自己独到的见解。曾经辅导过若干个非计算机专业的

    2024年02月13日
    浏览(40)
  • Github clone 报错:Failed to connect to github.com port 443 after 21071 ms: Couldn‘t connect to server

    clone自己的仓库里的东西然后报错了 然后把地址的https改成http就好了

    2024年02月11日
    浏览(25)
  • git提交Failed to connect to github.com port 443解决方法

    最近在提交代码到GitHub,一直提示提交失败 Push: unable to access \\\'https://github.com/username/project.git/\\\': Failed to connect to github.com port 443 after 21140 ms: Couldn\\\'t connect to server ,我以为是网络太差了,直接使用代理软件,还是同样的提示, 所以咨询了一位优秀的前端开发kaimo,才知道需要g

    2024年01月25日
    浏览(41)
  • Git报错: Failed to connect to github.com port 443 解决方案

    两种情况: 第一种情况自己有vpn ,网页可以打开github。说明命令行在拉取/推送代码时并没有使用vpn进行代理 第二种情况没有vpn ,这时可以去某些网站上找一些代理ip+port 解决办法:配置http代理Windows、Linux、Mac OS 中 git 命令相同: 配置socks5代理 配置http代理 注意: 命令中的

    2024年02月11日
    浏览(34)
  • git报错:Failed to connect to github.com port 443: Timed out

    git push代码时,报错 接着发现无法ping通github.com 思路 修改hosts文件,让主机跳过DNS服务器,直接根据hosts配置信息替换域名 步骤 1、在ipaddress.com查询Github真实IP地址 2、打开hosts文件,一般位于 C:WindowsSystem32driversetchosts ,添加如下配置 3、再ping一下,成功! 而后正常push代码

    2024年01月20日
    浏览(42)
  • git 报错信息:Failed to connect to github.com port 443: Timed out

    因为国内网络登录GitHub会有明显的卡顿,所以我开启了加速器。 由于开启的加速器,在执行push命令的时候,会出现  port 443:time out 错误 或也可以像我一样在电脑中安装SwitchHosts,然后在其中配置同样的信息   发送成功。

    2024年02月13日
    浏览(28)
  • Git报错 -> Failed to connect to github.com port 443 after ***** ms: Couldn‘t connect to server

    这是由于本机系统代理端口和git端口不一致导致的。 查看本机端口 修改git端口 再次push [报错解决] Failed to connect to github.com port 443 after ***** ms: Couldn‘t connect to server

    2024年02月06日
    浏览(37)
  • git报错:Failed to connect to github.com port 443 after 21084 ms: Couldn‘t connect to serve

    Git报错: Failed to connect to github.com port 443 after 21084 ms: Couldn\\\'t connect to serve 当使用clone、pull、push等git命令的时候出现上述报错信息,大概率是由于开了代理的问题。解决方式如下: 首先,关闭本地的代理,可以通过计算机系统自带的代理设置查看当前代理是否开启。 如果本地

    2024年02月12日
    浏览(23)
  • git报错:Failed to connect to github.com port 443 after 21061 ms: Couldn‘t connect to server

    我在git push的时候遇到这个报错, 用以下方法解决: 在终端输入以下命令: 示例: windows电脑,代理IP地址和端口 查看路径:         网络和 Internet 代理 手动设置代理 编辑 原理: Git 发送请求给代理服务器,代理服务器代表 Git 连接到 GitHub 的 HTTPS 服务器,此时会用

    2024年04月13日
    浏览(26)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包