- One of the two Most Common
git rebaseIn this most commonly used merge strategy, history is just one straight line. When you create a branch, make some commits in that branch, the time you’re ready to merge, there is no new merge on the main branch. That way main’s pointer is just moved straight forward and history is one straight line.
- One of the two Most Common
git merge --no-ffIn Recursive merge, after you branch and make some commits, and there are some new original commits on the "main" branch. At merge time, git recurses over the branch and creates a new merge commit. The merge commit continues to have two parents.
| Fast Forward | Recursive |
|---|---|
| No new commits on the main branch | New commits on the main branch |
| A linear history | Commit 2 parents |
| No merge commits | A merge commit is created |
git rebase |
git merge --no-ff |
There is nothing right or wrong with either one of the strategies but with a fast forward merge you have a straight line of history and with recursive merge it is made up of multiple lines.