现象:
在家开了工具,可以通过网页访问到公司的仓库,但是通过终端却无法访问,报错
git clone git@gitlab.xx.xxxx.cn:xxxx/xxxx/YourRepository.git
Cloning into 'YourRepository'...
ssh: Could not resolve hostname gitlab.xx.xxxx.cn: nodename nor servname provided, or not known
fatal: Could not read from remote repository.
思路:
- 是否是终端设置了代理,导致不能正常解析
通过这种方式操作了一遍,发现没什么效果 - 既然是DNS解析不出来,是不是可以换个DNS服务器呢?
解决方式:
查看自己的DNS服务器是8.8.8.8,换成114.114.114.114
重新拉取代码,成功解析域名。