使用git clone时,出现 fatal: unable to access ‘https://...的解决办法

文章目录

      • 一、问题
      • 二、解决办法

一、问题

使用git clone时,出现 fatal: unable to access ‘https://…

二、解决办法

1、首先ping了一下github.com的网站发现不通

ping github.com

出现ping request could not find host (name). please check name and try again,但是ping其他网站没有问题,说明网络时没有问题的。可能是DNS的映射出现问题。
2、解决办法为:添加映射地址,映射的文件地址为:C:/windows/system32/drivers/etc,
使用git clone时,出现 fatal: unable to access ‘https://...的解决办法_第1张图片

找到文件,复制一份到桌面作为备份。然后用域名查询工具IP查询查询github.com网站的域名,得到ip地址。
在这里插入图片描述
在这里插入图片描述

然后找到映射文件用vscode打开(用VScode打开,用记事本打开不好使,亲身经历)
使用git clone时,出现 fatal: unable to access ‘https://...的解决办法_第2张图片

将IP地址和域名添加到最后一行。
在这里插入图片描述

再此ping github.com网站完美解决问题。git clone命令也正常运行了。特此记录。

你可能感兴趣的:(错误集,git)