Why does git merge sometimes create a commit, sometimes does not?

前端 未结 4 1698
梦如初夏
梦如初夏 2021-01-30 04:45

When I do git merge from another branch to current workspace, git sometimes makes a new commit:

Merge remote-tracking branch xxx into xxx

4条回答
  •  -上瘾入骨i
    2021-01-30 05:36

    When no fast-forward --no-ff option is presented git will not create a commit if the head of the branch you are merging in is the ancestor of the merged branch. In this case (no --no-ff option) it will just move the head (it's a fast-forward).

提交回复
热议问题