git clone 时报错,提示 ssh: Could not resolve hostname github.com: Name or service not known
在git clone克隆仓库代码时,提示 ssh: Could not resolve hostname github.com: Name or service not known

百度后,解决方法如下:

  1. ping github.com
    获取到github.com的ip为13.xxx.xxx.xxx
    git clone 时报错,提示 ssh: Could not resolve hostname github.com: Name or service not known
  2. 在/etc/hosts中添加一行如下:
    此文件的路径如下:
    git clone 时报错,提示 ssh: Could not resolve hostname github.com: Name or service not known
    右击hosts文件,并以记事本格式打开。然后在文件最后一行添加如下内容:
    13.xxx.xxx.xxx github.com

此时,在进行git clone xxx时,就可以进入到输入码云账户及密码的步骤了。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-18
  • 2022-12-23
  • 2021-09-18
  • 2021-07-11
相关资源
相似解决方案