简体   繁体   English

如何将多个补丁合并为一个大补丁?

[英]How to merge multiple patches into one big patch?

I have about 20 patch files in one directory.我在一个目录中有大约 20 个补丁文件。

I need to merge them into one big patch file.我需要将它们合并到一个大补丁文件中。 I have already read multiple other questions, but combinediff can only merge 2 diffs into one one.我已经阅读了多个其他问题,但 combineiff 只能将 2 个差异合并为一个。

How can I merge all 20 patches into one?如何将所有 20 个补丁合并为一个?

You could simply apply all those patches, getting 20 new commits ( git am , which can take multiple patches ).您可以简单地应用所有这些补丁,获得 20 个新的提交( git am ,这可能需要多个补丁)。

Then, as a case of " Practical uses of git reset --soft ? ", reset (--soft) to your original commit.然后,作为“ git reset --soft ? 的实际用途”的案例,将(--soft)重置为您的原始提交。
The index would be one representing the applied 20 patches.该索引将是代表应用的 20 个补丁的索引。

A simple git diff would then generate a global patch.然后,一个简单的git diff将生成一个全局补丁。

A simpler approach would be to use git apply 20 times, which does not generate a commit更简单的方法是使用git apply 20 次,这不会生成提交

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

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