How do I `git rebase -i` and prevent “You asked to amend the most recent commit, but doing so would make it empty.”?

前端 未结 4 535
天命终不由人
天命终不由人 2021-01-01 13:23

I want to run a git rebase -i some-hash.

When I run it, I get the error:

You asked to amend the most recent commit, but doing so

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-01 13:45

    Seems like running:

    git commit --allow-empty
    git rebase --continue

    Creates 2 squashed commits, instead of one. Running git rebase -i some-hash allows me to squash the 2 new commits into one.

提交回复
热议问题