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

[PATCH] doc: fix git grep args order in Quick Reference

From
GGGuillaume Jacob via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 16, 2026, 14:15 UTC
Message-ID
<pull.2069.git.1773670536808.gitgitgadget@gmail.com>
From: Guillaume Jacob <guillaume@absolut-sensing.com>

The example provided has its arguments in the wrong order. The revision should follow the pattern, and not the other way around.

Signed-off-by: Guillaume Jacob <guillaume@absolut-sensing.com>
---
    doc: fix git grep args order in Quick Reference
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2069%2Fguillaume-jcb%2Fdoc-fix-args-order-in-quick-ref-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2069/guillaume-jcb/doc-fix-args-order-in-quick-ref-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2069
 Documentation/user-manual.adoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/user-manual.adoc b/Documentation/user-manual.adoc
index 7696987117..64009baf37 100644
--- a/Documentation/user-manual.adoc
+++ b/Documentation/user-manual.adoc
@@ -4466,7 +4466,7 @@ $ git show		    # most recent commit
 $ git diff v2.6.15..v2.6.16 # diff between two tagged versions
 $ git diff v2.6.15..HEAD    # diff with current head
 $ git grep "foo()"	    # search working directory for "foo()"
-$ git grep v2.6.15 "foo()"  # search old tree for "foo()"
+$ git grep "foo()" v2.6.15  # search old tree for "foo()"
 $ git show v2.6.15:a.txt    # look at old version of a.txt
 -----------------------------------------------
 

base-commit: dc6ecd5354dca88d51b6d6562777fc8fc10d77e1
-- 
gitgitgadget
Next: Junio C Hamano
Message 1 of 2 in “doc: fix git grep args order in Quick Reference”
  1. doc: fix git grep args order in Quick ReferenceGuillaume Jacob via GitGitGadget, Mar 16, 2026
  2. Junio C HamanoMar 16, 2026

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.