【发布时间】:2017-12-04 04:29:50
【问题描述】:
我正在尝试为 Github 上的其他存储库做出贡献,但在尝试合并 2 个分支时遇到错误:
error: Your local changes to the following files would be overwritten by merge:
game.js
Please commit your changes or stash them before you merge.
Aborting
这里是 git 状态输出:
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: game.js
我也试过 git push 但是
$ git push
remote: Permission to udacity/asteroids.git denied to Oalbacha.
fatal: unable to access 'https://github.com/udacity/asteroids.git/': The requested URL returned error: 403
你能帮忙吗?如果您需要更多信息,请告诉我。谢谢!
【问题讨论】:
-
如果您在状态中看到,它仍然表示您对文件 game.js 进行了未提交的更改。如果您再次修改了文件,则需要在尝试合并之前提交/重置这些更改。
-
推送导致错误代码403,因为您不允许推送到该项目的分支。项目主人必须授予您权限才能推送给它的主人。尝试对另一个分支做同样的事情。
标签: github git-merge git-commit git-stash