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

这篇具有很好参考价值的文章主要介绍了fatal: unable to connect to github.com:github.com[0: 20.205.243.166]: errno=Unknown error。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

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

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

解决办法:编辑全局配置

查看全局配置:

git config --global -l

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

 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 会根据配置的顺序进行匹配与替换,但是可能会导致意外的行为或错误,所以我的解决办法是删除这些配置:

git config --global http.sslverify true
git config --global --unset url.git://github.com/.insteadof
git config --global --unset url.https://github.com.insteadof
git config --global --unset url.https://github.com/.insteadof
git config --global --unset url.git://github.com.insteadof

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

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

重新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

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

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

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

git config --global http.postBuffer 100M

git clone 成功

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

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

到了这里,关于fatal: unable to connect to github.com:github.com[0: 20.205.243.166]: errno=Unknown error的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

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

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

相关文章

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

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

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

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

二维码1

领取红包

二维码2

领红包