fatal: unable to access '': Could not resolve host: github.com - git clone失败

今天在服务器使用git clone命令时报错:

Cloning into 'GLACNet'...
fatal: unable to access 'https://github.com/tkim-snu/GLACNet.git/': Could not resolve host: github.com

然后执行命令ping github.com,也失败了:

ping: unknown host github.com

解决方案

修改/etc/hosts文件:

sudo vim /etc/hosts 

进入vim编辑该文件,在最后一行加入:

192.30.253.112 github.com

wq保存退出,再使用 git 命令就可以了。

你可能感兴趣的:(工具使用)