git中cherry-pick啥意思

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git中cherry-pick啥意思相关的知识,希望对你有一定的参考价值。

参考技术A 直接把某一次commit拿过来,作为最新一次commit
就像是直接摘了一颗樱桃加在链表最前面,所以叫cherry-pick本回答被提问者和网友采纳

sh 使用git cherry-pick从分支中选择提交

# Move on the branch to which you want to "add" commits
git checkout dev

# Cherry-pick a single commit
git cherry-pick <hash>

# Cherry-pick multiple commits
git cherry-pick <hash> <hash> <hash>

# Cherry-pick a range of commits, both ends included
git cherry-pick <hash>^...<hash>

# in case there is a conflict, resolve it and then:
git add <file_to_merge>
git commit
git cherry-pick --continue

# In case you want to undo the cherry-picking:
git cherry-pick --abort

以上是关于git中cherry-pick啥意思的主要内容,如果未能解决你的问题,请参考以下文章

git不同分支局部代码合并 git cherry-pick

Git cherry-pick极速理解

git篇之Cherry-pick

Git Cherry-Pick 和 Git Revert 有啥区别? [关闭]

Git 场景 :从一个分支cherry-pick多个commit

在 Git 中 tree-ish 是啥意思?