2014-01-07 59 views
0

我有一个由6个文件组成的Git补丁。如何从Git补丁文件应用特定文件?

  1. abc.php
  2. pqr.php
  3. zyz.php
  4. rrr.php
  5. ggg.php
  6. yyy.php

我只想申请来自.patch的文件rrr.php包含上述文件

git-apply命令包含--exclude参数,但不包括--include

如何从.patch文件中只应用rrr.php?

回答

0

你说:

git-apply命令包括--exclude阿根廷,但不--include

git-apply(1) Manual Page说:

--include=<path-pattern>

将更改应用到文件配套配件g给定的路径模式。这在导入补丁集时很有用,您想要在其中包含某些文件或目录。

尝试:

git apply --include=rrr.php some.patch 

使用Git版本1.8.4验证。