What is a fast-forward merge in Git?

If the target branch has no new commits since your branch was created, Git does not need a merge commit. It just moves the pointer of the target branch forward to the last commit of your branch.

Terminal output

$ git merge feature
Updating 0057196..22ea2c5
Fast-forward
g.txt | 1 +
1 file changed, 1 insertion(+)
create mode 100644 g.txt

To force a merge commit even in this case, use git merge --no-ff. See Git Merge.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.