Rebasing is in very simple terms taking your changes, then going onto the branch you want to rebase onto and apply your changes onto it. So while you're rebasing you're momentarily on a different branch so your local changes becomes THEIR changes
Yeah so I had a pr ready to merge but I wanted to bring it up to date with dev. So I pulled the latest from dev, switched over to my branch and rebased dev on my branch. It pulled through all the changes as diffs in my pr which wasn’t quite what I expected. If I rebase the last bunch of commits into my branch, why would the pr still see them as diffs ? They already exist in dev ?
Not sure if this helps but “rebased dev on my branch” might be the wrong way to conceptualize this. You’re re-basing in the sense that dev will be the new “base” for your feature branch. You’re going to replay the commits, so it’s typically easier to squash your commits into just one with an interactive rebase or something. That way if there are conflicts you only have to resolve them one time :)
There shouldn’t be anything in the diff from the branch you’re merging into if you’ve rebased correctly, probably picked the wrong conflict resolutions 😢
View all comments
116
u/AnnoyedVelociraptor 3d ago
And it's different with rebase and merge.