git merge --no-commit vs git cherry-pick --no-commit

前端 未结 2 2035
深忆病人
深忆病人 2021-02-06 22:18

Is there any difference between git merge --no-commit and git cherry-pick --no-commit?

And is there any difference in history if I commit after

2条回答
  •  我寻月下人不归
    2021-02-06 22:44

    While git-merge is used to join two or more development histories together, git-cherry-pick is used to apply changes introduced by some existing commits.

    So then, once you commit after performing a git-merge, Git will add what's called a merge commit. In the other side, when cherry-pick(ing) commits, git will apply the changes introduced by these commits on the top of your working tree (There's no fusion between two or many branches). Put another way, Commits are cloned and put on top of your branch.

    Take a look at Git Cherry-pick vs Merge Workflow to undestand the differences based on a repo maintainer real needs.

提交回复
热议问题