0

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?

2
  • 4
    Because it makes it clear that the main branch did not receive 10 individual commits (each of which individually passed validation and acceptance testing), but rather one batch of 10 commits that was validated and tested as a unit. Your future "git bisect" will thank you. Commented Jul 1 at 22:27
  • 1
    It makes the git history more readable and provide more context. More details on this answer: stackoverflow.com/a/21817388/717372 (Personally, I would love that GitHub "rebase and merge" feature allows --no-ff, useful when you have more than 1 commit in the PR)
    – Philippe
    Commented Jul 2 at 7:06

0