多次承诺樱桃采摘 [英] Multiple commits cherry-picking

查看:170
本文介绍了多次承诺樱桃采摘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在主分支中有33个提交的提交。现在我需要保持整洁的记录。所以现在我已经创建了功能分支,并且我试图将这33个提交分类到不同的功能分支中。那么是否有可能一次选择多个提交以复制相关的功能分支?我在尝试多次提交cherry-pick命令时也遇到了冲突。

I have 33 commits in the main branch that are meshed up. Now I need to maintain the record neatly. So now I have created feature branches and I'm trying to classify those 33 commits in different feature branches. So can it be possible to pick multiple commits at a time to copy in the relevant feature branch? And I am also facing its conflicts when I tried multiple commits with the cherry-pick command.

git cherry-pick A B C

这里A,B,C是提交'hashcode。

here A, B, C are the commits' hashcode.

推荐答案

你做得对。简介是

You do it correct. The synopsis is

git cherry-pick [--edit] [-n] [-m parent-number] [-s] [-x] [--ff] <commit>...

git cherry-pick 从左到右提交。你可以订购你想要的。
如果你有冲突,你有三个选择。你可以 git cherry-pick --quit (停止樱桃采摘并让你的树处于他当前的状态), git cherry-pick --abort (停止挑选并重置你的分支到你开始之前的状态 git cherry-pick )或者用编辑器解决这个冲突或使用 git mergetool 然后 git cherry-pick --continue 转到列表中的下一个提交。

git cherry-pick goes from left to right commit. You can order how you want. If you have a conflict you have three choices. you can git cherry-pick --quit (stop cherry-picking and let your tree in his current state), git cherry-pick --abort (stop cherry-picking and reset your branch to the state where he was before you start git cherry-pick) or resolve this conflict with an editor or with git mergetool and then git cherry-pick --continue go to next commit in your list.

这篇关于多次承诺樱桃采摘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆