简体   繁体   English

特定的增量需要在git上从一个分支合并到另一个分支

[英]specific delta need to merge on git from one branch to another

I have two branches b1 and b2 on git. 我在git上有两个分支b1和b2。

I have made changes lets say c1 c2 c3 c4 c5 c6 though respected bug b1 b2 b3 b4 b5 b6 bug number on branch b1, I want to merge only change c1 c3 c4 respected bug b1 b3 b4 to branch b2. 我已经做出更改,尽管说b1 b2 b3 b4 b5 b6 bug编号在分支b1上受了bug b1 b2 b3 b4 b5 b6 bug的影响,我只想将c1 c3 c4尊重bug b1 b3 b4合并到分支b2。 how to do it through git command line and if conflicts come how to resolve it. 如何通过git命令行来完成它,如果有冲突来解决它。

Your commits aren't in a position where they can be taken with a merge command, so your best bet is git cherry-pick . 您的提交不在可以使用merge命令进行的位置,因此最好的选择是git cherry-pick Use like this: 像这样使用:

$ git checkout b2
$ git cherry-pick c1 c3 c4

If there are conflicts, you'll be prompted to resolve them interactively. 如果有冲突,系统将提示您以交互方式解决它们。

There won't be any tracking that they're in, so if you end up merging later on, those will show up as conflicts.1 它们不会进入任何跟踪状态,因此,如果您以后合并,这些将显示为冲突。1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM