码迷,mamicode.com
首页 > 系统相关 > 详细

工具-github在linux下面没有git push报错

时间:2015-12-25 06:19:35      阅读:292      评论:0      收藏:0      [点我收藏+]

标签:

time: 2015/12/25

1. 描述:

  error: The requested URL returned error: 403 Forbidden while accessing https://github.com ...

2. 吐槽:

  在网上随便一搜一大堆的都是各种拷贝,说把.git/config下面的["origin"]下面的url改一下,如下所示

[remote "origin"]  
    url = https://github.com/username/example.git  
[remote "origin"]  
    url = https://wangz@github.com/username/example.git  

  结果,没啥鸟用,最后还是在stack overflow上面的问题上解决了。如果跟我一样上面方法不能解决问题的,可以看看下面的解决办法是否可用...

3. 原因:

(1)参考[1]中投票最多(目前为止是475票支持)说:虽然显示https支持读写,github似乎仅仅只支持ssh读写.这个github还是支持https的,因为我两台linux,一台一开始配置的是https,而另外一台是ssh,都是可以读写的。那自己猜测不支持https的是不是github版本控制,现在这台出问题的是一开始配置的ssh,版本是1.7.1。另外一台,打开了再看一下

4. 解决

(1)https不支持,又想起来自己一开始设置的就是ssh,所以把上面的["origin"]的url一行改为:

url = ssh://git@github.com/username/Study.git

结果报错!说什么rsa密钥的问题啊之类的

ERROR: Were doing an SSH key audit.
Reason: unverified due to lack of use
Please visit https://github.com/settings/ssh/ ...
to approve this key so we know its safe.
Fingerprint: ... ...
fatal: The remote end hung up unexpectedly

(2)参考[2]打开到github,看一下rsa公钥的问题,结果看到自己sshkeys那里的最右边一个按钮就是approve,点了一下就ok了。

(3)重新提交,binggo!
5. 总结

(1)国内网站各种问题解决各种坑爹

(2)在百度如果没搜到解决办法,或者一大批雷解决办法无效的时候,去stack overflow上面搜一下

6. 参考

[1]http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed#

[2]http://stackoverflow.com/questions/19722521/error-the-requested-url-returned-error-403-forbidden-while-accessing

 

工具-github在linux下面没有git push报错

标签:

原文地址:http://www.cnblogs.com/pk-run/p/5074774.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!