git push是报Permission denied (publickey)错误解决

今天晕了半天了,搞了个git工程到github上,以为很简单,因为之前也弄过,那知道搞了大半天都搞不好,一直报如下错误

D:\javawork\ee-0.0.1-SNAPSHOT>git push -u origin master
Warning: Permanently added the RSA host key for IP address '192.30.252.130' to t
he list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

查看了官网说明

https://help.github.com/articles/generating-ssh-keys/

主要是如下几步骤

1 ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

2 ssh-agent -s

3 ssh-add ~/.ssh/id_rsa

4 再把公钥加入到github网站上去

 

但就卡在第3步了,ssh-add ~/.ssh/id_rsa这个一直执行不成功

报Permission denied (publickey).

 

找了很多资料,有说要ssh-agent bash

有说ssh-agent
       ssh-add ~/.ssh/id_key

 

都不行,最后看到一片文章

http://blog.csdn.net/wswqiang/article/details/7200022

大概意思要使用windows Git 版本,试了下,还真行,在windows Git上不用执行ssh-add,即可git push成功

自此,问题解决。

转载于:https://www.cnblogs.com/xywq/p/4673428.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值