From 0a93fb8a9cc6fa1bf7dba6b498cba3f57f5017a1 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 27 Sep 2011 13:43:12 -0700 Subject: grep: teach --untracked and --exclude-standard options In a working tree of a git managed repository, "grep --untracked" would find the specified patterns from files in untracked files in addition to its usual behaviour of finding them in the tracked files. By default, when working with "--no-index" option, "grep" does not pay attention to .gitignore mechanism. "grep --no-index --exclude-standard" can be used to tell the command to use .gitignore and stop reporting hits from files that would be ignored. Also, when working without "--no-index", "grep" honors .gitignore mechanism, and "grep --no-exclude-standard" can be used to tell the command to include hits from files that are ignored. Signed-off-by: Junio C Hamano --- Documentation/git-grep.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index e019e760b4..6269007b94 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -9,7 +9,7 @@ git-grep - Print lines matching a pattern SYNOPSIS -------- [verse] -'git grep' [--cached] +'git grep' [--cached] [--untracked] [--exclude-standard] [-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp] [-v | --invert-match] [-h|-H] [--full-name] [-E | --extended-regexp] [-G | --basic-regexp] @@ -36,6 +36,19 @@ OPTIONS Instead of searching in the working tree files, check the blobs registered in the index file. +--untracked:: + In addition to searching in the tracked files in the working + tree, search also in untracked files. + +--no-exclude-standard:: + Also search in ignored files by not honoring the `.gitignore` + mechanism. Only useful with `--untracked`. + +--exclude-standard:: + Do not pay attention to ignored files specified via the `.gitignore` + mechanism. Only useful when searching files in the current directory + with `--no-index`. + -a:: --text:: Process binary files as if they were text. -- cgit v1.2.3