> The blocker here isn’t Git. In fact, the reason you can’t go with option #4 is that your code review tools probably don’t support it
I do stacked commits (branches off branches) all the time. Github certainly supports PRs based on such.
I do stacked commits (branches off branches) all the time. Github certainly supports PRs based on such.
git switch offshoot
git rebase --onto feature branchpoint^
Will replay your offshoot branch onto its underlying feature branch after the feature branch has been rebased. The branchpoint is the first commit that diverges from the feature branch.Finding the branchpoint commit is the only real annoyance here -- if there's a ref or a better trick for finding it, I'm all ears.
git checkout main
git pull
git checkout feature-branch-1
git rebase -i -
git checkout feature-branch-2
git rebase -i -
...
There's most likely a more efficient way to do this, but I find that referring to the most recently checked-out branch with a single hyphen is a lesser-known feature, so perhaps it will be helpful :)