From what I understand, rebasing essentially moves the base of your branch to a more recent (the most recent?) commit to make it seem like you branched off later than you actually did.
This makes it easy to do a simple fast-forward merge that creates a more linear history without a merge commit.
When you merge a PR in GitHub (for example), there's a "rebase and merge" option. I'm assuming that it does what is described above.
The thing is though, that one could specify --no-ff
to a local merge after rebasing to force a merge commit - I'm just wondering if there is any reason why someone would want to do this.
Basically: rebase and merge --no-ff is something someone can do, but is there ever any situation where it makes sense to do this?
--no-ff
, useful when you have more than 1 commit in the PR)