【问题标题】:fatal: unable to access 'https://github.com/SOME_NAME/SOME_PROJECT.git/': The requested URL returned error: 403致命:无法访问“https://github.com/SOME_NAME/SOME_PROJECT.git/”:请求的 URL 返回错误:403
【发布时间】:2016-12-05 18:38:55
【问题描述】:
 git push
 remote: Permission to newGithubAccount/newGithubAccountProject.git denied to myOldGithubAccount.
 fatal: unable to access 'https://github.com/newGithubAccount/newGithubAccountProject.git/': The requested URL returned error: 403

我收到了 403 错误,我知道是发现了错误的访问,并且错误消息清楚地告诉了我原因: 但是,因为我的 git push 使用的是我以前的 github 帐户的凭据,所以我更新了我的 git 全局配置并生成了新的 .ssh/id_rsa 并将 ssh 密钥添加到我的新 github 帐户中。 但是这个错误仍然存​​在,我在这个网站和 Github.help 页面上进行了广泛的搜索,但仍然没有运气,请帮忙。

我想我需要以某种方式完全清除我以前的 github 帐户的缓存或删除它,然后我才能使用我的新帐户访问 github。 或者其他方法,请指教! 非常感谢!

【问题讨论】:

    标签: git ssh


    【解决方案1】:

    之前的遥控器配置为使用 HTTP 协议。您可以使用set-url 远程命令来更新您的远程以使用基于 SSH 的协议。

    git remote set-url origin git@github.com:newGithubAccount/newGithubAccountProject.git

    https://help.github.com/articles/changing-a-remote-s-url/

    【讨论】:

    • 漂亮!非常感谢! :)
    猜你喜欢
    • 2020-08-04
    • 1970-01-01
    • 2022-07-17
    • 2022-12-05
    • 1970-01-01
    • 2016-10-25
    • 1970-01-01
    • 1970-01-01
    • 2021-08-17
    相关资源
    最近更新 更多