美文网首页
拉取代码报错ssh: Could not resolve hos

拉取代码报错ssh: Could not resolve hos

作者: 令狐冲_ | 来源:发表于2023-06-09 17:51 被阅读0次

    现象:
    在家开了工具,可以通过网页访问到公司的仓库,但是通过终端却无法访问,报错

    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.
    

    思路:

    1. 是否是终端设置了代理,导致不能正常解析
      通过这种方式操作了一遍,发现没什么效果
    2. 既然是DNS解析不出来,是不是可以换个DNS服务器呢?
      解决方式:
      查看自己的DNS服务器是8.8.8.8,换成114.114.114.114
      重新拉取代码,成功解析域名。

    相关文章

      网友评论

          本文标题:拉取代码报错ssh: Could not resolve hos

          本文链接:https://www.haomeiwen.com/subject/lhcbldtx.html