Code

Documentation: let asciidoc align related options
[git.git] / Documentation / git-apply.txt
index 70d19f63eb562063dd373a4474f6efc0e2ea32dc..feb51f124ac8a806e65d41f6274c58de64d2991f 100644 (file)
@@ -14,11 +14,11 @@ 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
 -----------
-Reads supplied diff output and applies it on a git index file
+Reads supplied 'diff' output and applies it on a git index file
 and a work tree.
 
 OPTIONS
@@ -64,7 +64,7 @@ OPTIONS
        without using the working tree. This implies '--index'.
 
 --build-fake-ancestor <file>::
-       Newer `git-diff` output has embedded 'index information'
+       Newer 'git-diff' output has embedded 'index information'
        for each blob to help identify the original version that
        the patch applies to.  When this flag is given, and if
        the original versions of the blobs is available locally,
@@ -78,7 +78,7 @@ the information is read from the current index instead.
        Apply the patch in reverse.
 
 --reject::
-       For atomicity, `git-apply` by default fails the whole patch and
+       For atomicity, 'git-apply' by default fails the whole patch and
        does not touch the working tree when some of the hunks
        do not apply.  This option makes it apply
        the parts of the patch that are applicable, and leave the
@@ -102,7 +102,7 @@ the information is read from the current index instead.
        ever ignored.
 
 --unidiff-zero::
-       By default, `git-apply` expects that the patch being
+       By default, 'git-apply' expects that the patch being
        applied is a unified diff with at least one line of context.
        This provides good safety measures, but breaks down when
        applying a diff generated with --unified=0. To bypass these
@@ -113,7 +113,7 @@ discouraged.
 
 --apply::
        If you use any of the options marked "Turns off
-       'apply'" above, `git-apply` reads and outputs the
+       'apply'" above, 'git-apply' reads and outputs the
        information you asked without actually applying the
        patch.  Give this flag after those flags to also apply
        the patch.
@@ -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.
 
@@ -165,9 +165,9 @@ behavior:
 * `error-all` is similar to `error` but shows all errors.
 
 --inaccurate-eof::
-       Under certain circumstances, some versions of diff do not correctly
+       Under certain circumstances, some versions of 'diff' do not correctly
        detect a missing new-line at the end of the file. As a result, patches
-       created by such diff programs do not record incomplete lines
+       created by such 'diff' programs do not record incomplete lines
        correctly. This option adds support for applying such patches by
        working around this bug.
 
@@ -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
 -------------
 
@@ -191,7 +199,7 @@ apply.whitespace::
 
 Submodules
 ----------
-If the patch contains any changes to submodules then `git-apply`
+If the patch contains any changes to submodules then 'git-apply'
 treats these changes as follows.
 
 If --index is specified (explicitly or implicitly), then the submodule