git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/4] apply: apply works outside a repository

From
Björn Gustavsson <bgustavsson@gmail.com>
Date
Nov 22, 2009, 16:19 UTC
Message-ID
<4B0964A1.2040302@gmail.com>

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.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
---
 Documentation/git-apply.txt |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
index 4f791ee..6857a68 100644
--- a/Documentation/git-apply.txt
+++ b/Documentation/git-apply.txt
@@ -23,6 +23,10 @@ DESCRIPTION
 Reads supplied 'diff' output and applies it on a git index file
 and a work tree.
 
+'git-apply' can also be used outside a git repository as long
+as no options that require a git repository are given
+(e.g. `--index` or `--cached`).
+
 OPTIONS
 -------
 <patch>...::
-- 
1.6.5.3.298.g39add
Next: Junio C Hamano
Message 1 of 2 in “apply: apply works outside a repository”
  1. 2/4 apply: apply works outside a repositoryBjörn Gustavsson, Nov 22, 2009
  2. Junio C HamanoNov 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.