Edit:
I was fundamentally using git rebase -i ... wrong and thinking of it the wrong way when I wrote this question. git rebase -i [some branch name or tag or commit hash] allows you to explicitly identify the start of the sequence of commits that you are interactively editing (e.g. git rebase -i HEAD~3). Relying on the default argument in the case of a branch tracking another branch is a weird way to use interactive rebase, not a normal one.
git rebase -i is incredibly useful for reordering commits and combining them. However, sometimes I want to reorder, drop, combine, or split commits without the rebasing behavior. The main use case I can think of for doing this is cleaning up a development branch first and then rebasing it and potentially dealing with merge conflicts rather than doing both steps at once.
In the following scenario I am working in a git repository where the main branch has a linear history and reviewed commits are incorporated into the main branch via cherry-pick. I am working on commits B, C and D on a branch called my-feature. Let's further suppose that my-feature tracks the main branch. Commit A in the main branch is a big refactor.
Future * | A D (my-feature) | / * C | / * B | / * Past Suppose I want to reorder C and B. I want to reorder them first before marching my-feature forward beyond A.
I first want to do this change:
Future * | A D (my-feature) | / * B | / * C | / * Past and then do this change:
Future D (my-feature) / B / C / * | A | * | * | * Past
my-featuretracks the main branch, then usinggit rebase -iwill rebaseB,C,Donto the main branch.my-featurehas the main branch set as the upstream branch.git branch -u ...