今天执行 push 的时候 报了一个错
FunctionTest apple$ git push
fatal: unable to access 'https://github.com/liuboliu/FunctionTest.git/': Could not resolve host: github.com
处理方式这样
FunctionTest apple$ ping github.com
然后终端输出gi thub 信息
然后前往路径
/etc/hosts
如图
这个hosts 文件我们是不能直接编辑的
我这里是复制了一份,拖到桌面上,然后将副本的文件名改为hosts,
并在里面添加上
52.74.223.119 github.com
如图:
然后将桌面上的hosts文件拖到/etc/文件夹中,将原有的文件替换,
然后再执行push,就可以了