@matheusbsbs / matheus-bagliano / commits / 38a39647b4
Fork 0

apply: apply works outside a repository

The documentation for 'git apply' talks about applying a patch/diff to the index and to the working tree, which seems to imply that it will not work outside a git repository. Actually 'git patch' works outside a repository (which can be useful especially for applying binary or rename patches that the standard "patch" utility cannot handle), so the documentation should mention it. Thanks to Junio for suggesting better wording. Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Björn Gustavsson committed Nov 22, 2009 at 20:43 UTC 38a39647b43ea57c96bd6e4a351d0d5353c805bb
1 file changed +6 -3
Documentation/git-apply.txt
+6 -3
@@ -3,7 +3,7 @@ git-apply(1)
3
4 NAME
5 ----
6 -git-apply - Apply a patch on a git index file and/or a working tree
6 +git-apply - Apply a patch to files and/or to the index
7
8
9 SYNOPSIS
@@ -20,8 +20,11 @@ SYNOPSIS
20
21 DESCRIPTION
22 -----------
23 -Reads supplied 'diff' output and applies it on a git index file
24 -and a work tree.
23 +Reads the supplied diff output (i.e. "a patch") and applies it to files.
24 +With the `--index` option the patch is also applied to the index, and
25 +with the `--cache` option the patch is only applied to the index.
26 +Without these options, the command applies the patch only to files,
27 +and does not require them to be in a git repository.
28
29 OPTIONS
30 -------