如何一次性应用多个 git 补丁

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18494750/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 08:58:00  来源:igfitidea点击:

how to apply multiple git patches in one shot

gitrepository

提问by amaechler

I am having around 100 patches like below,is there a way to apply all of them in one shot?

我有大约 100 个像下面这样的补丁,有没有办法一次性应用所有补丁?

0001-*.patch,0002-*.patch,0003-*.patch............

回答by amaechler

You can use git am, for example

git am例如,您可以使用

$ git am *.patch

For all available options, checkout the manpage.

对于所有可用选项,请查看手册页。

回答by Constantin Konstantinidis

To get one commit for all patches:

要为所有补丁获得一次提交:

git apply *.patch
git add -A
git commit -m '<your message>'

Patches are applied in the order of the directory listing.

修补程序按目录列表的顺序应用。

git applyhas most of the flags of git am

git apply有大部分的标志git am