从github克隆项目的时候,总是git不下来,报错如下:
(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文件:
vim /etc/hosts - 按i进入insert模式
- 然后切换到网址www.ipaddress.com/查找下面两个地址:
github.com
github.global.ssl.fastly.net
- 选择对应的ip地址和名称写入host文件
5. 点击esc键退出编辑模式,然后:wq退出host文件之后重新git clone即可成功解决。