首页 > 其他 > 详细

ssh: Could not resolve hostname gitcafe.com: nodename nor servname provided, or not known

时间:2015-07-20 21:32:35      阅读:4635      评论:0      收藏:0      [点我收藏+]

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

ssh: Could not resolve hostname gitcafe.com: nodename nor servname provided, or not known

原文:http://www.cnblogs.com/ayseeing/p/4662588.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!