Frequently Asked Question
What is a fast-forward merge?
A fast-forward merge happens when the branch you are merging into has not moved since you branched off it, its tip is still an ancestor of the branch you are merging from. Git does not need to create a new merge commit because the new commits already form a single straight line ahead of the current branch; it simply advances the current branch's pointer forward to the tip of the other branch. No history is created, just a label that moves.
Fast-forward is Git's default when the situation allows it. If you want to force a
merge commit even in that case, for example, to make it obvious in the log that a
pull request was integrated, use git merge --no-ff. Conversely, git merge --ff-only refuses to merge unless a fast-forward is possible, which is handy in
scripts that want to abort if real merging would be required. Many teams set
pull.ff = only to make git pull refuse to create surprise merge commits.