Member-only story
Git Merge vs Rebase
The Three Types of Merge
Merging is adding the work done in one branch to another. There are three ways one could merge one branch into another:
- fast-forward merging,
- squash merging,
- and merging by creating a merge commit.
I would call the 3rd option “real merging” to emphasize it when necessary.
TL;DR
This piece subtitled “The Three Types of Merge” focuses mainly on setting up the ground for the discussion on whether to use rebase or merge. A follow-up article called “Git Merge vs Rebase and Where to Use Them” will cover the pros and cons of each workflow.

Fast-Forward Merge
When you have only new commits in the source branch, fast-forward merging is simply adding those commits to the destination branch. Easy!
Rebase and Fast-Forward Merge
The fast-forward merge is only possible if the target branch is an ancestor of the source branch, which is usually not the case. You have added 2 commits to your feature branch and by the time you want to merge it back to master, your colleagues have added 4 commits to it. In this situation, we say the feature branch is 2 commits ahead of the master and 4 commits behind.