Comment by pastel8739
10 hours ago
I agree that this is annoying and unintuitive. But I don’t see the simplest solution here, so:
All you need to do is pull main, then do an interactive rebase with the next branch in your stack with ‘git rebase -i main’, then drop all the commits that are from the branch you just merged.
I typically prefix my commit messages with the ticket number to make it easier to spot the commits to drop.