Suppose I have a branch that consists of three commits, one of them empty:
# On branch test
3208910 empty
85c949c bar
0c1a615 foo
I want to rebase it on the root and from the man page it seems that --root --keep-empty
is exactly what I need.
However, both git rebase -i --root
and git rebase -i --root --keep-empty
omit the empty commit and show me this plan instead:
pick 0c1a615 foo
pick 85c949c bar
How can I rebase the entire branch and keep empty commits at the same time?
P.S. I needed this to remove a few first commits on the branch and I managed to achieve that with filter-branch
as described in this SO answer, but I'm still interested in knowing if rebase
is capable of that. Is it a bug in Git that I found? It's hard to believe this behavior is intentional but I'm not sure.
P.P.S. I found that I can edit the plan by hand and add pick 3208910
.