无法将存储库推送到 Github

时间:2021-07-21 15:10:22

标签: java github intellij-15

我正在尝试将一些代码推送到我的 Github 存储库。 我在 Github 上有一个基本存储库,我在 IntelliJ 上使用了它。进行更改后,我试图将其推回 Github。但是,我不断收到以下错误: 远程:xxxxxx.git 的权限被 xxxxxx 拒绝。 致命:无法访问“https://github.com/xxxxxx/xxxxxx.git/”:请求的 URL 返回错误:403 我是 Github 和 IntelliJ 的新手,我不知道我做错了什么。

我什至尝试从终端推送存储库。但是,得到了同样的错误

λ git push 信息:请在浏览器中完成身份验证... 远程:springframeworkguru/spring5webapp.git 的权限被拒绝为 mohitagwl。 致命:无法访问“https://github.com/springframeworkguru/spring5webapp.git/”:请求的 URL 返回错误:403

1 个答案:

答案 0 :(得分:0)

原来我的仓库是从别人的仓库分叉出来的。因此,我不得不更改我的 repo 的所有者以允许 git push。

最初:

λ git remote -v 原点https://github.com/notMyRepo/app.git(获取) 原点https://github.com/notMyRepo/app.git(推送)

我改变了它: λ git remote set-url origin https://github.com/myRepo/app