zoukankan      html  css  js  c++  java
  • ssh: Could not resolve hostname gitcafe.com: nodename nor servname provided, or not known

    今天 git push 的时候报如下错误:

    ssh: Could not resolve hostname gitcafe.com: nodename nor servname provided, or not known
    
    fatal: Could not read from remote repository.
    
     
    
    Please make sure you have the correct access rights
    
    and the repository exists.
    

      最开始还以为是权限被修改了,后来问了朋友下,他建议使用 https 协议试试,看是否成功,如何在使用 ssh 协议的同时又使用 https 协议呢?我们只需要新增一个 remote 即可,步骤如下:

    1、添加远程仓库 

    git remote add remoteName url
    

      remoteName 仓库名称,可以自定义,不可和已有的仓库名称同名。这个名称,push和pull的时候是需要用到的。默认的是 origin

    2、获取或推送

    // pull
    git pull remoteName branchName
    
    // push
    git push remoteName branchName
    

      结果发现push成功了,因此可以排除权限问题了。

    那么出现这个原因的问题是什么?可能是服务器不稳定导致 ssh协议被gateway认证失败了,或者一些其他未知的原因。

  • 相关阅读:
    mysql总结
    git总结
    转:如何判断一家公司的好坏
    路越走越窄,尤其做技术的
    百度面试总结
    背叛
    which和whereis 命令
    bzoj3263 陌上花开 CDQ模板
    bzoj 2653middle
    暑假第十九测
  • 原文地址:https://www.cnblogs.com/ayseeing/p/4662588.html
Copyright © 2011-2022 走看看