简体   繁体   English

我如何大量挑选提交?

[英]How do I massively cherry-pick commits?

In a team where 2 developers were working on different things, but both were using develop as the integration branch (working with gitflow) it turned out to be one developer's job is incomplete (but this job was not programmed for the current release) and the other is complete (this one is programmed for the current release).在一个团队中,有 2 个开发人员从事不同的工作,但都使用develop作为集成分支(使用 gitflow),结果证明是一个开发人员的工作不完整(但该工作未针对当前版本进行编程)和另一个是完整的(这个是为当前版本编程的)。

Now, I'm trying to cherry pick every commit of the developer whose changes were programmed for the current release, but they are A LOT.现在,我试图挑选开发人员的每一个提交,其更改是为当前版本编程的,但它们很多。 My first thought was to cherry pick the commit of the pull request he submitted, but the parent for the cherry pick parameter is confusing, and it also brings some conflicts.我的第一个想法是cherry pick他提交的pull request的commit,但是cherry pick参数的parent比较混乱,也带来了一些冲突。

I'm not sure whether fixing these conflicts caused by cherry-picking the merge commit itself are worth it, or should I just cherry-pick one by one?我不确定解决这些由挑选合并提交本身引起的冲突是否值得,还是我应该一一挑选?

Write a 1-liner to get all "missing" revisions from the developer you want and cherry-pick them one by one (perhaps report and drop the ones that generate a conflict).编写一个1-liner以从您想要的开发人员那里获取所有“缺失”的修订,并逐一挑选它们(也许报告并删除产生冲突的那些)。

Roughly something like this (lots of details left out, for sure):大致是这样的(当然省略了很多细节):

git log --pretty=%h whatever-conditions-to-get-list-of-revisions | while read revision; do git cherry-pick $revision; if [ $? -ne 0 ]; then echo "Revision $revision failed to be cherry picked.... stopping"; break; fi; done

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

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