gpt4 book ai didi

git - 致命的 : unable to access 'https://github.com/SOME_NAME/SOME_PROJECT.git/' : The requested URL returned error: 403

转载 作者:太空狗 更新时间:2023-10-29 13:42:51 25 4
gpt4 key购买 nike

 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 key 添加到我的新 github 帐户中。但是这个错误仍然存​​在,我在这个网站和 Github.help 页面上进行了广泛的搜索,但仍然没有运气,请帮忙。

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

最佳答案

之前的远程配置为使用HTTP协议(protocol)。您可以使用 set-url 远程命令更新您的 Remote 以使用基于 SSH 的协议(protocol)。

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

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

关于git - 致命的 : unable to access 'https://github.com/SOME_NAME/SOME_PROJECT.git/' : The requested URL returned error: 403,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38686025/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com