GIT-GREP(1) Git Manual GIT-GREP(1) (NAME) git-grep - (SYNOPSIS) git grep [-a | --text] [-I] [--textconv] [-i | --ignore-case] [-w | --word-regexp] [-v | --invert-match] [-h|-H] [--full-name] [-E | --extended-regexp] [-G | --basic-regexp] [-P | --perl-regexp] [-F | --fixed-strings] [-n | --line-number] [--column] [-l | --files-with-matches] [-L | --files-without-match] [(-O | --open-files-in-pager) []] [-z | --null] [ -o | --only-matching ] [-c | --count] [--all-match] [-q | --quiet] [--max-depth ] [--[no-]recursive] [--color[=] | --no-color] [--break] [--heading] [-p | --show-function] [-A ] [-B ] [-C ] [-W | --function-context] [(-m | --max-count) ] [--threads ] [-f ] [-e] [--and|--or|--not|(|)|-e ...] [--recurse-submodules] [--parent-basename ] [ [--[no-]exclude-standard] [--cached | --untracked | --no-index] | ...] [--] [...] (DESCRIPTION) blob blob (tree) . . . (OPTIONS) --cached blob . --untracked . --no-index . grep(1) -r pathspec pathspec gitglossary(7) . --cached --untracked . grep.fallbackToNoIndex CONFIGURATION . --no-exclude-standard .gitignore . --untracked . --exclude-standard .gitignore . --no-index . --recurse-submodules (checked out) . . --untracked --no-index . -a, --text . --textconv textconv. --no-textconv textconv. . -i, --ignore-case . -I . --max-depth . 1- . (wildcard) . "a*" "a*" "*" --max-depth . -r, --recursive --max-depth=-1 . --no-recursive --max-depth=0. -w, --word-regexp ( ). -v, --invert-match . -h, -H . -h . -H -h . --full-name . . -E, --extended-regexp, -G, --basic-regexp / POSIX . . -P, --perl-regexp (Perl) . . . -F, --fixed-strings ( ). -n, --line-number . --column ( ) . -l, --files-with-matches, --name-only, -L, --files-without-match ( ). git diff --name-only --files-with-matches . -O[], --open-files-in-pager[=] ( grep). "less" "vi" . pager . pager (: core.pager git-config(1)). -z, --null \0 . <<>> core.quotePath (: git-config(1)). -o, --only-matching () . -c, --count . --color[=] . always () never auto . --no-color . --color=never. --break . --heading . -p, --show-function . git diff (: Defining a custom hunk-header gitattributes(5)). -, -C , --context -- . -A , --after-context -- . -B , --before-context -- . -W, --function-context . git diff (: Defining a custom hunk-header gitattributes(5)). -m , --max-count . -v --invert-match . 1- (). 0 . --threads grep . NOTES ON THREADS grep.threads CONFIGURATION . -f . \0 . \0 . . --perl-regexp PCRE v2 . 2.23.0 \0 . ASCII \0 --ignore-case . \0 . -e . - grep . or . --and, --or, --not, ( ... ) . --or . --and --or . -e . --all-match --or . -q, --quiet 0 . ... blob . -- . ... . glob(7) . pathspec gitglossary(7) . (EXAMPLES) git grep 'time_t' -- '*.[ch]' time_t c. h. . git grep -e '#define' --and \( -e MAX_PATH -e PATH_MAX \) #define MAX_PATH PATH_MAX . git grep --all-match -e NODE -e Unexpected NODE Unexpected . git grep solution -- :^Documentation solution Documentation. (NOTES ON THREADS) --open-files-in-pager --threads ( grep.threads) . ( --cached ) --textconv . --threads=1 . (CONFIGURATION) git-config(1) . : grep.lineNumber true -n . grep.column true --column . grep.patternType . basic extended fixed perl --basic-regexp --extended-regexp --fixed-strings --perl-regexp default grep.extendedRegexp basic extended . grep.extendedRegexp true --extended-regexp . grep.patternType default . grep.threads grep . ( 0) . grep.fullName true --full-name . grep.fallbackToNoIndex true git grep git grep --no-index . false . (GIT) git(1) Git 2.55.0 2026-06-29 GIT-GREP(1)