I have a Git patch consisting 6 files.
I want to apply only rrr.php from the .patch
file consisting the above files
git-apply
command includes an --exclude
arg, but not --include
.
How can I apply only rrr.php from the .patch
file?
The patch file (also called a patch for short) is a text file that consists of a list of differences and is produced by running the related diff program with the original and updated file as arguments. Updating files with patch is often referred to as applying the patch or simply patching the files.
You say:
git-apply
command includes an--exclude
arg, but not--include
The git-apply
(1) Manual Page says:
--include=<path-pattern>
Apply changes to files matching the given path pattern. This can be useful when importing patchsets, where you want to include certain files or directories.
Try:
git apply --include=rrr.php some.patch
Verified with Git version 1.8.4.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With