zoukankan      html  css  js  c++  java
  • 工具-github在linux下面没有git push报错

    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: We're 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 it's 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

  • 相关阅读:
    c++单例模式为什么不在析构函数中释放静态的单例对象(转)
    Ubuntu 树莓派2b交叉编译环境
    多线程std::cout 深入研究
    c++11的 move并没有实际move
    RTC时间设置
    QT 第三方串口库COM10以上无法读取问题
    ubuntu gcc-5 安装
    STM32正交编码器驱动电机
    (转)layoutSubviews总结
    自定义视图控制器切换(iOS)
  • 原文地址:https://www.cnblogs.com/pk-run/p/5074774.html
Copyright © 2011-2022 走看看