{"thread":{"id":"21712","subject":"[PATCH 2/4] apply: apply works outside a repository","startedAt":"2009-11-22T19:43:42Z","lastAt":"2009-11-22T19:43:42Z","messageCount":1,"participants":["Björn Gustavsson"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"128121","messageId":"4B09946E.6050409@gmail.com","threadId":"21712","inReplyTo":null,"subject":"[PATCH 2/4] apply: apply works outside a repository","fromName":"Björn Gustavsson","fromEmail":"bgustavsson@gmail.com","sentAt":"2009-11-22T19:43:42Z","receivedAt":"2009-11-22T19:43:42Z","isPatch":true,"sender":{"key":"bgustavsson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/74840?v=4"},"body":"The documentation for 'git apply' talks about applying a\npatch/diff to the index and to the working tree, which seems\nto imply that it will not work outside a git repository.\n\nActually 'git patch' works outside a repository (which can\nbe useful especially for applying binary or rename patches that\nthe standard \"patch\" utility cannot handle), so the documentation\nshould mention it.\n\nThanks to Junio for suggesting better wording.\n\nSigned-off-by: Björn Gustavsson <bgustavsson@gmail.com>\n---\n Documentation/git-apply.txt |    9 ++++++---\n 1 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt\nindex 0156ca9..0c55ca9 100644\n--- a/Documentation/git-apply.txt\n+++ b/Documentation/git-apply.txt\n@@ -3,7 +3,7 @@ git-apply(1)\n \n NAME\n ----\n-git-apply - Apply a patch on a git index file and/or a working tree\n+git-apply - Apply a patch to files and/or to the index\n \n \n SYNOPSIS\n@@ -20,8 +20,11 @@ SYNOPSIS\n \n DESCRIPTION\n -----------\n-Reads supplied 'diff' output and applies it on a git index file\n-and a work tree.\n+Reads the supplied diff output (i.e. \"a patch\") and applies it to files.\n+With the `--index` option the patch is also applied to the index, and\n+with the `--cache` option the patch is only applied to the index.\n+Without these options, the command applies the patch only to files,\n+and does not require them to be in a git repository.\n \n OPTIONS\n -------\n-- \n1.6.5.3.298.g39add\n"}]}