Skip to content

Commit

Permalink
apply: apply works outside a repository
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Björn Gustavsson authored and Junio C Hamano committed Nov 22, 2009
1 parent 64485b4 commit 38a3964
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Documentation/git-apply.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ git-apply(1)

NAME
----
git-apply - Apply a patch on a git index file and/or a working tree
git-apply - Apply a patch to files and/or to the index


SYNOPSIS
Expand All @@ -20,8 +20,11 @@ SYNOPSIS

DESCRIPTION
-----------
Reads supplied 'diff' output and applies it on a git index file
and a work tree.
Reads the supplied diff output (i.e. "a patch") and applies it to files.
With the `--index` option the patch is also applied to the index, and
with the `--cache` option the patch is only applied to the index.
Without these options, the command applies the patch only to files,
and does not require them to be in a git repository.

OPTIONS
-------
Expand Down

0 comments on commit 38a3964

Please sign in to comment.