What merge does
git merge combines the history of another branch into the current branch. Git examines the commit graph and chooses an appropriate merge strategy.
Fast-forward merge
If the current branch has not diverged, Git can simply move the branch pointer forward. No extra merge commit is required because the history already forms a straight line.
Three-way merge
When both branches contain unique commits, Git can create a merge commit that records the integration of the two lines of development. This preserves the fact that the histories diverged and were later combined.