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认证失败了,或者一些其他未知的原因。

  • 相关阅读:
    二维数组的查找问题
    将字符串编码成数值,求数值最大和问题(今日头条笔试题)
    链表的倒序打印
    求方程的近似解
    多边形构成问题(今日头条笔试题)
    各种语言数据类型大小
    luoguP1551 亲戚
    Codeforces 764 A-B
    Mixing Chemicals
    Day 8 of JZJX
  • 原文地址:https://www.cnblogs.com/ayseeing/p/4662588.html
Copyright © 2011-2022 走看看