If merge a branch to another branch, which contains current branch, git will perform a fast forward merge. In this case git will just move the branch pointer.
Let’s start with this repository.
Current branch is dev. When merge dev with master. It is a fast forward merge.
Commits and commit IDs keep the same. Only the dev branch pointer moved.
It is possible to disable fast forward by adding –no-ff option to the merge command. E.g $ git merge master –no-ff. The result is below.