• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

fatal: unable to connect to github.com:github.com[0: 20.205.243.166]: errno=Unknown error

武飞扬头像
csdg
帮助1

问题描述:git clone https:// 时出错

学新通

解决办法:编辑全局配置

查看全局配置:

git config --global -l

学新通

 http.sslverify=false:这个配置意味着禁用了对HTTPS连接进行SSL证书验证。这可能会导致不安全的连接,可以设置为true

url.git://github.com/.insteadof=https://github.com/url.git://github.com.insteadof=https://github.com:这两个配置用于将Git协议(git://)的URL转换为HTTPS协议(https://)的URL(重复,通常情况下只需要配置一个即可生效)

url.https://github.com/.insteadof=git://github.com/url.https://github.com.insteadof=git://github.com:这两个配置用于将HTTPS协议(https://)的URL转换为Git协议(git://)的URL。这样的配置一般情况下较少使用,特别是当使用HTTPS连接时。如果不需要显式地将HTTPS URL替换为git:// URL,可以删除其中一个或两个配置。

原因分析

url.git://github.com/.insteadof=https://github.com/和url.https://github.com/.insteadof=git://github.com/ 同时存在时,Git 会根据配置的顺序进行匹配与替换,但是可能会导致意外的行为或错误,所以我的解决办法是删除这些配置:

  1.  
    git config --global http.sslverify true
  2.  
    git config --global --unset url.git://github.com/.insteadof
  3.  
    git config --global --unset url.https://github.com.insteadof
  4.  
    git config --global --unset url.https://github.com/.insteadof
  5.  
    git config --global --unset url.git://github.com.insteadof

再次执行以下命令可以看到删除成功:

学新通

重新git clone https://: ,出现新的错误:

error: RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno 10054
error: 432 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

学新通

原因分析:出现这种问题可能是文件太大了,curl的postBuffer的默认值较小,需要在终端调整为到合适的大小

修改GIT缓存的大小为100M,如果依然报错,继续调大:

git config --global http.postBuffer 100M

git clone 成功

学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhghegkg
系列文章
更多 icon
同类精品
更多 icon
继续加载