git fatal:unable to connect to github.com: github.com[0: 20.205.243.166]: errno=Connection timed out

1. git 下载报错

github.com[0: 20.205.243.166]: errno=Connection timed out

在这里插入图片描述

2. 解决问题

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

输入以下命令

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

直接复制运行即可。
在这里插入图片描述
vim 打开 .git/config 文件,并在最后添加如下内容:

[url "[email protected]:"]
    pushInsteadOf = git://github.com/
    pushInsteadOf = https://github.com/

到此问题解决!

猜你喜欢

转载自blog.csdn.net/qq_36393978/article/details/128659642