首页 > 服务器    日期:2024-06-08 / 浏览

一、从github使用Git Clone遇到问题:

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

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

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

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

解决方案一: 

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

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

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

解决方案二: 

执行以下命令:

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

觉得上面的内容有用吗?快来点个赞吧!

点赞() 我要打赏

温馨提示 : 本站内容来自会员投稿以及互联网,所有源码及教程均为作者总结编辑,请大家在使用过程中提前做好备份,以免发生无法预知的错误,源码类教程请勿直接用于生产环境!

 可能感兴趣的文章