git clone时出现 Failed connect to github.com:443; Connection refused问题

1.在Windows下,win + R运行cmd

ping GitHub 得到IP地址,如图:

 

 

2.在shell中输入如下命令

sudo vim /etc/hosts

如图,将之前的代理注释掉,将刚刚复制的ip添加到hosts文件下

 

 

3.再重新git clone就可以了

原因:在网上看了一些文章是dns解析域名的问题

参考文章:(27条消息) 使用git push时出现Failed to connect to github.com port 443: Connection refused_git push的时候出现443_秋青42的博客-CSDN博客

posted @ 2023-01-23 21:25  balabalahhh  阅读(2446)  评论(0)    收藏  举报