特定提交的Git合并和Git-cherry-pick有什么区别? [英] what is the difference between a Git-merge and Git-cherry-pick for a specific commit?
问题描述
之间是否有区别:
git merge <commit-id>
和git cherry-pick <commit-id>
吗?
其中"commit-id"是我要进入master分支的新分支的提交的哈希.
Is there a difference between a :
git merge <commit-id>
and git cherry-pick <commit-id>
?
where ''commit-id'' is hash of the commit from my new branch that I want to get into master branch.
推荐答案
cherry-pick
仅将一次提交提交到您当前的分支中.
merge
占据整个分支(可能是几次提交),然后将其合并到您的分支中.
cherry-pick
takes exactly one commit into your current branch.
merge
takes the entire branch (might be several commits) and merge it to your branch.
与将其与<commit-id>
合并时相同-它不仅接受特定的提交,而且还接受下面的提交(如果有的话).
Same if you merge it with <commit-id>
- it doesn't take only the specific commit but the below commits (if there's any) as well.
这篇关于特定提交的Git合并和Git-cherry-pick有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!