Search code examples
gitfast-forward

What is fast-forwarding?


Is it OK to assume that fast-forward means all commits are replayed on the target branch and the HEAD is set to the last commit on that branch?


Solution

  • When you try to merge one commit with a commit that can be reached by following the first commit’s history, Git simplifies things by moving the pointer forward, because there isn't any divergent work to merge together—this is called a fast-forward.

    For more: 3.2 Git Branching - Basic Branching and Merging

    In another way,

    If master has not diverged, instead of creating a new commit, Git will just point the master to the latest commit of the feature branch. This is a fast forward.

    There won't be any merge commit in fast-forwarding merge.