我有一个包含6个文件的Git补丁。
- abc.php
- pqr.php
- zyz.php
- rrr.php
- ggg.php
- yyy.php
我只想从上述文件中应用rrr.php的内容到.patch
文件中。
git-apply
命令包含--exclude
参数,但没有--include
参数。
如何仅应用.patch
文件中的rrr.php内容?
我有一个包含6个文件的Git补丁。
我只想从上述文件中应用rrr.php的内容到.patch
文件中。
git-apply
命令包含--exclude
参数,但没有--include
参数。
如何仅应用.patch
文件中的rrr.php内容?
你说:
git-apply
命令包含一个--exclude
参数,但没有--include
--include=<path-pattern>
将更改应用于匹配给定路径模式的文件。这在导入补丁集时非常有用,可以选择性地包含某些文件或目录。
尝试:
git apply --include=rrr.php some.patch
已经通过Git 1.8.4版本验证。