当前位置: 代码网 > 服务器>服务器>Linux > Ubuntu22.04系统:fatal: 无法连接到 github.com

Ubuntu22.04系统:fatal: 无法连接到 github.com

2024年05月12日 Linux 我要评论
一、从github使用git clone遇到问题:git clone git://github.com/***/***.git时提示:正克隆到 'caffe'... fatal: 无法

一、从github使用git clone遇到问题:

git clone git://github.com/***/***.git时提示:

正克隆到 'caffe'... fatal: 无法连接到 github.com:

github.com[0: 20.205.243.166]: errno=连接超时


 

解决方案一: 

这种错误一般是由于使用 git://*** 下载会出现,改成使用 https:// 方式访问即可。

重新执行克隆命令,结果如下图所示:

解决方案二: 

执行以下命令:

git config --global url.https://github.com/.insteadof git://github.com/
git config --global url."https://".insteadof git://

解决方案三:

1、执行以下命令:

vim ~/.gitconfig

或:

vim ~/.git/config

2、输入以下内容:

 [url "git@github.com:"]
     pushinsteadof = git://github.com/
     pushinsteadof = https://github.com/

3、保存修改:

:wq

以上三种方案都可解决问题,重新执行克隆命令,结果如下图所示:

到此这篇关于ubuntu22.04系统:fatal: 无法连接到 github.com的文章就介绍到这了,更多相关fatal: 无法连接到 github内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com