我做了git rebase master
,修复了文件中报告的冲突,然后git add
文件解决了冲突。然后我执行了 git rebase --continue
,得到了这个:
Applying: Fixed unit test
No changes - did you forget to use 'git add'? If there is nothing left to stage, chances are that something else already introduced the same changes; you might want to skip this patch.
When you have resolved this problem, run "git rebase --continue". If you prefer to skip this patch, run "git rebase --skip" instead. To check out the original branch and stop rebasing, run "git rebase --abort".
知道我在这里缺少什么吗?我应该执行 git rebase --skip 吗?
最佳答案
如果您使用的是 Mac OS X,那么首先您应该禁用 revisiond
,因为它会在 rebase 过程中弄乱您的工作树中的文件,从而导致不可预测和损坏的行为:
git config --global core.trustctime false
this article 中解释了该问题,非常感谢@nickfalk谁指出来的。
至于你的rebase,这种情况在实践中并不少见。 让我们尝试思考正在发生的事情的步骤:
当您将当前分支 rebase 到另一个分支之上时,git 会将 HEAD 移动到另一个分支,并开始应用您在当前分支中拥有的唯一提交。
在重放其中一个提交时,您遇到了冲突。您解决了它,但结果是没有要提交的更改,也没有要在此提交中重播的内容。
实际上,这意味着您拒绝了正在重放的当前提交中的更改。所以,如果你不需要这个提交的任何东西,跳过它是正常的。所以 git rebase --skip
在这里很有意义。
关于git rebase --continue 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21889741/