What is the difference between a fast-forward merge and a merge commit?
BeginnerConceptMerge, rebase and cherry-pick
Answer
A fast-forward happens when the target branch has no new commits since the feature branched, so Git just moves the branch pointer and no new commit is created. Otherwise Git creates a merge commit with two parents. --no-ff forces a merge commit even when a fast-forward is possible, preserving the feature's grouping in history.
git merge --ff-only feature
git merge --no-ff feature
More on Merge, rebase and cherry-pick
How does a three-way merge work?IntermediateWhat does `git rebase` actually do?IntermediateMerge versus rebase: how do you decide?IntermediateWhat are squash merge, merge commit and rebase-and-merge on GitHub?IntermediateWhy does a squash-merged branch show as unmerged to `git branch --merged`?IntermediateWhat does `git cherry-pick` do?Beginner