logoalt Hacker News

pastel8739yesterday at 10:21 PM2 repliesview on HN

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.


Replies

claytonjytoday at 5:20 PM

This is what i often do, but i have never been able to get many coworkers onboard. In my experience I’d say less than 5% of all software folk i’ve worked with are willing to do an interactive rebase; everyone else finds it too scary

adregantoday at 1:09 AM

I typically prefix my commit messages with the ticket number to make it easier to spot the commits to drop.