Interface GrepOptions

GrepOptions defines the supported options for the Git grep command.

Hierarchy

  • GrepOptions

Properties

--after-context?: string | number

Shows the specified number of trailing lines, and places a line containing -- between contiguous groups of matches. See also --before-context and --context.

--all-match?: null

When multiple pattern expressions are combined with or, this flag limits the match to files that have lines to match all of them.

--before-context?: string | number

Shows the specified number of leading lines, and places a line containing -- between contiguous groups of matches. See also --after-context and --context.

--break?: null

Prints an empty line between matches from different files.

--cached?: null

Searches blobs in the index.

--column?: null

Prefixes the 1-indexed byte-offset of the first match from the start of the matching line.

--context?: string | number

Shows the specified number of leading and trailing lines, and places a line containing -- between contiguous groups of matches. See also --after-context and --before-context.

--count?: null

Shows the number of lines that match, instead of showing every matched line.

--exclude-standard?: null

Does not pay attention to ignored files specified via the .gitignore mechanism. Only useful with --no-index. See also --no-exclude-standard.

--files-with-matches?: null

Shows only the names of files that contain matches. See also --files-without-match.

--files-without-match?: null

Shows only the names of files that do not contain matches. See also --files-with-matches.

--fixed-strings?: null

Doesn’t interpret the pattern as a regex.

--function-context?: null

Shows the surrounding text from the previous line containing a function name up to the one before the next function name, effectively showing the whole function in which the match was found.

--heading?: null

Shows the filename above the matches in that file instead of at the start of each shown line.

--ignore-case?: null

Ignores case differences between the patterns and the files.

--invert-match?: null

Selects non-matching lines.

--line-number?: null

Prefixes the line number to matching lines.

--max-count?: string | number

Limits the number of matches per file.

--max-depth?: string | number

Descends at most the specified number of directory levels. A value of -1 means no limit.

--no-exclude-standard?: null

Searches ignored files by not honoring the .gitignore mechanism. Only useful with --untracked. See also --exclude-standard.

--no-index?: null

Searches files in the current directory that is not managed by Git.

--no-recursive?: null

Same as --max-depth=0. See also --recursive.

--no-textconv?: null

Does not honor textconv filter settings. See also --textconv.

--only-matching?: null

Prints only the matched (non-empty) parts of a matching line, with each such part on a separate output line.

--quiet?: null

Does not output matched lines; instead, exits with status 0 when there is a match and with non-zero status when there isn’t.

--recurse-submodules?: null

Recursively searches in each submodule that is active and checked out in the repository.

--recursive?: null

Same as --max-depth=-1; this is the default. See also --no-recursive.

--show-function?: null

Shows the preceding line that contains the function name of the match, unless the matching line is a function name itself.

--text?: null

Processes binary files as if they were text.

--textconv?: null

Honors textconv filter settings. See also --no-textconv.

--threads?: string | number

Specifies the number of grep worker threads to use.

--untracked?: null

Searches also in untracked files.

--word-regexp?: null

Matches the pattern only at word boundary.

-I?: null

Doesn’t match the pattern in binary files.

-e?: string | string[]

Specifies the pattern. Multiple patterns are combined by or. See also --all-match.

-h?: null

Suppresses the output of the filename for each match.

-z?: null

Usees \0 as the delimiter for pathnames in the output and prints them verbatim.