Differences between Git merge --squash and --no-commit

后端 未结 1 1117
被撕碎了的回忆
被撕碎了的回忆 2020-12-23 09:05

As the title says, I am not really clear about the differences between a git merge --squash and a git merge --no-commit.

As far as I unders

相关标签:
1条回答
  • 2020-12-23 09:56
    git merge --no-commit
    

    This is just like a normal merge but doesn't create a merge-commit. This commit will be a merge commit: when you look at the history, your commit will appear as a normal merge.

    git merge --squash
    

    This will merge the changes into your working tree without creating a merge commit. When you commit the merged changes, it will look like a new "normal" commit on your branch: without a merge commit in the history. It's almost like you did a cherry-pick on all the merged changes.

    0 讨论(0)
提交回复
热议问题