问题描述
我想运行 git rebase -i some-hash
。
当我运行它时,我得到错误:
When I run it, I get the error:
该错误看起来特定于单个提交,因为 - 允许
That error seems specific to a single commit, as --allow-empty
isn't an option I can pass to rebase.
显然 - keep-empty $>
不是我可以传递给rebase的选项。 c $ c>是我可以传递给 git rebase
的选项,但它似乎无法解决问题。
Apparently --keep-empty
IS an option I can pass to git rebase
, but it doesn't seem to fix the problem.
我该如何改变基础,并告诉git,如果rebase中的提交最终没有效果,请不要担心?
How can I rebase, and tell git, don't worry if a commit in the rebase is ends up having no effect?
推荐答案
看起来像跑步:
git commit --allow-empty
git rebase --continue
创建2个压扁的提交,而不是一个。
运行 git rebase -i some-hash
允许我将2个新提交压缩成一个。
Creates 2 squashed commits, instead of one.Running git rebase -i some-hash
allows me to squash the 2 new commits into one.
这篇关于我如何`git rebase -i`并阻止“您要求修改最近的提交,但这样做会使其为空。”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!