今天在服务器使用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 命令就可以了。

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐