从github上克隆项目时总是克隆失败,报错显示:
shell
(base) ubuntu@ubuntu-ThinkStation-P920:/media/ubuntu/incremental_learning$ git clone <https://github.com/weirdoYun/CLMS.git>
Cloning into 'CLMS'...
fatal: unable to access '<https://github.com/weirdoYun/CLMS.git/>': Could not resolve host: github.com
尝试下面方法,成功解决:
- 打开ubuntu host文件:
sudo vim /etc/hosts
- 输入i进入insert模式
- 去下面网站www.ipaddress.com/搜索以下两个域名:
查找对应IP地址,并输入host文件中,我的如下:
4. 然后重新git clone成功解决。