Code

Update draft release notes for 1.6.1
[git.git] / Documentation / git-apply.txt
index 182305e9a9f1188dedd97ce9e739a56c12764aab..feb51f124ac8a806e65d41f6274c58de64d2991f 100644 (file)
@@ -14,7 +14,7 @@ SYNOPSIS
          [--allow-binary-replacement | --binary] [--reject] [-z]
          [-pNUM] [-CNUM] [--inaccurate-eof] [--recount] [--cached]
          [--whitespace=<nowarn|warn|fix|error|error-all>]
-         [--exclude=PATH] [--verbose] [<patch>...]
+         [--exclude=PATH] [--directory=<root>] [--verbose] [<patch>...]
 
 DESCRIPTION
 -----------
@@ -121,7 +121,7 @@ discouraged.
 --no-add::
        When applying a patch, ignore additions made by the
        patch.  This can be used to extract the common part between
-       two files by first running `diff` on them and applying
+       two files by first running 'diff' on them and applying
        the result with this option, which would apply the
        deletion part but not addition part.
 
@@ -182,6 +182,14 @@ behavior:
        by inspecting the patch (e.g. after editing the patch without
        adjusting the hunk headers appropriately).
 
+--directory=<root>::
+       Prepend <root> 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
 -------------