X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgit-apply.txt;h=e726510ab158a2d8c58782bfbb7f0c7adf4b8c6c;hb=5fdb70983585ccde1540563a8c7458621f7a7407;hp=e9f724b2fa35cf18978dbcba9dcef7ed28a1b19d;hpb=2fd02c92dbb6e575b7e62ea9dfa85ef45ebe58b6;p=git.git diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt index e9f724b2f..e726510ab 100644 --- a/Documentation/git-apply.txt +++ b/Documentation/git-apply.txt @@ -14,7 +14,8 @@ SYNOPSIS [--allow-binary-replacement | --binary] [--reject] [-z] [-pNUM] [-CNUM] [--inaccurate-eof] [--recount] [--cached] [--whitespace=] - [--exclude=PATH] [--verbose] [...] + [--exclude=PATH] [--include=PATH] [--directory=] + [--verbose] [...] DESCRIPTION ----------- @@ -137,6 +138,17 @@ discouraged. be useful when importing patchsets, where you want to exclude certain files or directories. +--include=:: + 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. ++ +When --exclude and --include patterns are used, they are examined in the +order they appear on the command line, and the first match determines if a +patch to each path is used. A patch to a path that does not match any +include/exclude pattern is used by default if there is no include pattern +on the command line, and ignored if there is any include pattern. + --whitespace=:: When applying a patch, detect a new or modified line that has whitespace errors. What are considered whitespace errors is @@ -182,6 +194,14 @@ behavior: by inspecting the patch (e.g. after editing the patch without adjusting the hunk headers appropriately). +--directory=:: + Prepend to all filenames. If a "-p" argument was passed, too, + it is applied before prepending the new root. ++ +For example, a patch that talks about updating `a/git-gui.sh` to `b/git-gui.sh` +can be applied to the file in the working tree `modules/git-gui/git-gui.sh` by +running `git apply --directory=modules/git-gui`. + Configuration -------------