Non-Fast-Forward Merge (No Option)

Exploring Non-Fast-Forward Merge in Git

As explained, when the parent branch (e.g., master branch) is already ahead of the diverged point of the child branch, the merge action becomes a non-fast-forward merge. In this case, the merge action is recorded as a new commit.

The illustration in the main figure describes the before and after of the non-fast forward merge. In this case, the HEAD of the master branch moves forward integrating all commit histories under Branch_A.

We'll explain the non-fast-forward merge in more detail with command line examples below.

Command Line Example

The command line image below is a demonstration of the commit and merge actions, which are the same as the upper illustration in the main figure. M1, M2, M3, A1, and A2 are the commit messages already made before this demonstration. We'll explain the commands and responses in the command line in three steps.

Non-Fast-forward Merge (no option) Command Line Example
  1. Confirm the pre-merge commit history status by running the git log command on the master branch. You can see that the commit histories and branch statuses are the same as the ones illustrated in the main figure. (In this status, t