{
    "content": [
        {
            "type": "text",
            "text": "# git-grep (info)\n\n## NAME\n\ngit-grep - Print lines matching a pattern\n\n## SYNOPSIS\n\ngit grep [-a | --text] [-I] [--textconv] [-i | --ignore-case] [-w | --word-regexp]\n[-v | --invert-match] [-h|-H] [--full-name]\n[-E | --extended-regexp] [-G | --basic-regexp]\n[-P | --perl-regexp]\n[-F | --fixed-strings] [-n | --line-number] [--column]\n[-l | --files-with-matches] [-L | --files-without-match]\n[(-O | --open-files-in-pager) [<pager>]]\n[-z | --null]\n[ -o | --only-matching ] [-c | --count] [--all-match] [-q | --quiet]\n[--max-depth <depth>] [--[no-]recursive]\n[--color[=<when>] | --no-color]\n[--break] [--heading] [-p | --show-function]\n[-A <post-context>] [-B <pre-context>] [-C <context>]\n[-W | --function-context]\n[--threads <num>]\n[-f <file>] [-e] <pattern>\n[--and|--or|--not|(|)|-e <pattern>...]\n[--recurse-submodules] [--parent-basename <basename>]\n[ [--[no-]exclude-standard] [--cached | --no-index | --untracked] | <tree>...]\n[--] [<pathspec>...]\n\n## DESCRIPTION\n\nLook for specified patterns in the tracked files in the work tree,\nblobs registered in the index file, or blobs in given tree objects.\nPatterns are lists of one or more search expressions separated by\nnewline characters. An empty string as search expression matches all\nlines.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (39 subsections)\n- **EXAMPLES**\n- **NOTES ON THREADS**\n- **CONFIGURATION**\n- **GIT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "git-grep",
        "section": "",
        "mode": "info",
        "summary": "git-grep - Print lines matching a pattern",
        "synopsis": "git grep [-a | --text] [-I] [--textconv] [-i | --ignore-case] [-w | --word-regexp]\n[-v | --invert-match] [-h|-H] [--full-name]\n[-E | --extended-regexp] [-G | --basic-regexp]\n[-P | --perl-regexp]\n[-F | --fixed-strings] [-n | --line-number] [--column]\n[-l | --files-with-matches] [-L | --files-without-match]\n[(-O | --open-files-in-pager) [<pager>]]\n[-z | --null]\n[ -o | --only-matching ] [-c | --count] [--all-match] [-q | --quiet]\n[--max-depth <depth>] [--[no-]recursive]\n[--color[=<when>] | --no-color]\n[--break] [--heading] [-p | --show-function]\n[-A <post-context>] [-B <pre-context>] [-C <context>]\n[-W | --function-context]\n[--threads <num>]\n[-f <file>] [-e] <pattern>\n[--and|--or|--not|(|)|-e <pattern>...]\n[--recurse-submodules] [--parent-basename <basename>]\n[ [--[no-]exclude-standard] [--cached | --no-index | --untracked] | <tree>...]\n[--] [<pathspec>...]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "",
                "long": "--cached",
                "arg": null,
                "description": "Instead of searching tracked files in the working tree, search blobs registered in the index file."
            },
            {
                "flag": "",
                "long": "--no-index",
                "arg": null,
                "description": "Search files in the current directory that is not managed by Git."
            },
            {
                "flag": "",
                "long": "--untracked",
                "arg": null,
                "description": "In addition to searching in the tracked files in the working tree, search also in untracked files."
            },
            {
                "flag": "",
                "long": "--no-exclude-standard",
                "arg": null,
                "description": "Also search in ignored files by not honoring the .gitignore mechanism. Only useful with --untracked."
            },
            {
                "flag": "",
                "long": "--exclude-standard",
                "arg": null,
                "description": "Do not pay attention to ignored files specified via the .gitignore mechanism. Only useful when searching files in the current directory with --no-index."
            },
            {
                "flag": "",
                "long": "--recurse-submodules",
                "arg": null,
                "description": "Recursively search in each submodule that is active and checked out in the repository. When used in combination with the <tree> option the prefix of all submodule output will be the name of the parent project's <tree> object. This option has no effect if --no-index is given."
            },
            {
                "flag": "-a",
                "long": "--text",
                "arg": null,
                "description": "Process binary files as if they were text."
            },
            {
                "flag": "",
                "long": "--textconv",
                "arg": null,
                "description": "Honor textconv filter settings."
            },
            {
                "flag": "",
                "long": "--no-textconv",
                "arg": null,
                "description": "Do not honor textconv filter settings. This is the default."
            },
            {
                "flag": "-i",
                "long": "--ignore-case",
                "arg": null,
                "description": "Ignore case differences between the patterns and the files."
            },
            {
                "flag": "-I",
                "long": null,
                "arg": null,
                "description": "Don't match the pattern in binary files."
            },
            {
                "flag": "",
                "long": "--max-depth",
                "arg": "<depth>",
                "description": "For each <pathspec> given on command line, descend at most <depth> levels of directories. A value of -1 means no limit. This option is ignored if <pathspec> contains active wildcards. In other words if \"a*\" matches a directory named \"a*\", \"*\" is matched literally so --max-depth is still effective."
            },
            {
                "flag": "-r",
                "long": "--recursive",
                "arg": null,
                "description": "Same as --max-depth=-1; this is the default."
            },
            {
                "flag": "",
                "long": "--no-recursive",
                "arg": null,
                "description": "Same as --max-depth=0."
            },
            {
                "flag": "-w",
                "long": "--word-regexp",
                "arg": null,
                "description": "Match the pattern only at word boundary (either begin at the beginning of a line, or preceded by a non-word character; end at the end of a line or followed by a non-word character)."
            },
            {
                "flag": "-v",
                "long": "--invert-match",
                "arg": null,
                "description": "Select non-matching lines."
            },
            {
                "flag": "-H",
                "long": null,
                "arg": null,
                "description": "By default, the command shows the filename for each match. -h option is used to suppress this output. -H is there for completeness and does not do anything except it overrides -h given earlier on the command line."
            },
            {
                "flag": "",
                "long": "--full-name",
                "arg": null,
                "description": "When run from a subdirectory, the command usually outputs paths relative to the current directory. This option forces paths to be output relative to the project top directory."
            },
            {
                "flag": "-G",
                "long": "--basic-regexp",
                "arg": null,
                "description": "Use POSIX extended/basic regexp for patterns. Default is to use basic regexp."
            },
            {
                "flag": "-P",
                "long": "--perl-regexp",
                "arg": null,
                "description": "Use Perl-compatible regular expressions for patterns. Support for these types of regular expressions is an optional compile-time dependency. If Git wasn't compiled with support for them providing this option will cause it to die."
            },
            {
                "flag": "-F",
                "long": "--fixed-strings",
                "arg": null,
                "description": "Use fixed strings for patterns (don't interpret pattern as a regex)."
            },
            {
                "flag": "-n",
                "long": "--line-number",
                "arg": null,
                "description": "Prefix the line number to matching lines."
            },
            {
                "flag": "",
                "long": "--column",
                "arg": null,
                "description": "Prefix the 1-indexed byte-offset of the first match from the start of the matching line."
            },
            {
                "flag": "-L",
                "long": "--files-without-match",
                "arg": null,
                "description": "Instead of showing every matched line, show only the names of files that contain (or do not contain) matches. For better compatibility with git diff, --name-only is a synonym for --files-with-matches. -O[<pager>], --open-files-in-pager[=<pager>] Open the matching files in the pager (not the output of grep). If the pager happens to be \"less\" or \"vi\", and the user specified only one pattern, the first file is positioned at the first match automatically. The pager argument is optional; if specified, it must be stuck to the option without a space. If pager is unspecified, the default pager will be used (see core.pager in git- config(1))."
            },
            {
                "flag": "-z",
                "long": "--null",
                "arg": null,
                "description": "Use \\0 as the delimiter for pathnames in the output, and print them verbatim. Without this option, pathnames with \"unusual\" characters are quoted as explained for the configuration variable core.quotePath (see git-config(1))."
            },
            {
                "flag": "-o",
                "long": "--only-matching",
                "arg": null,
                "description": "Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line."
            },
            {
                "flag": "-c",
                "long": "--count",
                "arg": null,
                "description": "Instead of showing every matched line, show the number of lines that match. --color[=<when>] Show colored matches. The value must be always (the default), never, or auto."
            },
            {
                "flag": "",
                "long": "--no-color",
                "arg": null,
                "description": "Turn off match highlighting, even when the configuration file gives the default to color output. Same as --color=never."
            },
            {
                "flag": "",
                "long": "--break",
                "arg": null,
                "description": "Print an empty line between matches from different files."
            },
            {
                "flag": "",
                "long": "--heading",
                "arg": null,
                "description": "Show the filename above the matches in that file instead of at the start of each shown line."
            },
            {
                "flag": "-p",
                "long": "--show-function",
                "arg": null,
                "description": "Show the preceding line that contains the function name of the match, unless the matching line is a function name itself. The name is determined in the same way as git diff works out patch hunk headers (see Defining a custom hunk-header in gitattributes(5)). -<num>, -C <num>, --context <num> Show <num> leading and trailing lines, and place a line containing -- between contiguous groups of matches."
            },
            {
                "flag": "-A",
                "long": "--after-context",
                "arg": "<num>",
                "description": "Show <num> trailing lines, and place a line containing -- between contiguous groups of matches."
            },
            {
                "flag": "-B",
                "long": "--before-context",
                "arg": "<num>",
                "description": "Show <num> leading lines, and place a line containing -- between contiguous groups of matches."
            },
            {
                "flag": "-W",
                "long": "--function-context",
                "arg": null,
                "description": "Show 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. The function names are determined in the same way as git diff works out patch hunk headers (see Defining a custom hunk-header in gitattributes(5))."
            },
            {
                "flag": "",
                "long": "--threads",
                "arg": "<num>",
                "description": "Number of grep worker threads to use. See grep.threads in CONFIGURATION for more information."
            },
            {
                "flag": "-f",
                "long": null,
                "arg": "<file>",
                "description": "Read patterns from <file>, one per line. Passing the pattern via <file> allows for providing a search pattern containing a \\0. Not all pattern types support patterns containing \\0. Git will error out if a given pattern type can't support such a pattern. The --perl-regexp pattern type when compiled against the PCRE v2 backend has the widest support for these types of patterns. In versions of Git before 2.23.0 patterns containing \\0 would be silently considered fixed. This was never documented, there were also odd and undocumented interactions between e.g. non-ASCII patterns containing \\0 and --ignore-case. In future versions we may learn to support patterns containing \\0 for more search backends, until then we'll die when the pattern type in question doesn't support them."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "The next parameter is the pattern. This option has to be used for patterns starting with - and should be used in scripts passing user input to grep. Multiple patterns are combined by or. --and, --or, --not, ( ... ) Specify how multiple patterns are combined using Boolean expressions. --or is the default operator. --and has higher precedence than --or. -e has to be used for all patterns."
            },
            {
                "flag": "",
                "long": "--all-match",
                "arg": null,
                "description": "When giving multiple pattern expressions combined with --or, this flag is specified to limit the match to files that have lines to match all of them."
            },
            {
                "flag": "-q",
                "long": "--quiet",
                "arg": null,
                "description": "Do not output matched lines; instead, exit with status 0 when there is a match and with non-zero status when there isn't. <tree>... Instead of searching tracked files in the working tree, search blobs in the given trees. -- Signals the end of options; the rest of the parameters are <pathspec> limiters. <pathspec>... If given, limit the search to paths matching at least one pattern. Both leading paths match and glob(7) patterns are supported. For more details about the <pathspec> syntax, see the pathspec entry in gitglossary(7)."
            }
        ],
        "examples": [
            "git grep 'timet' -- '*.[ch]'",
            "Looks for timet in all tracked .c and .h files in the working",
            "directory and its subdirectories.",
            "git grep -e '#define' --and \\( -e MAXPATH -e PATHMAX \\)",
            "Looks for a line that has #define and either MAXPATH or PATHMAX.",
            "git grep --all-match -e NODE -e Unexpected",
            "Looks for a line that has NODE or Unexpected in files that have",
            "lines that match both.",
            "git grep solution -- :^Documentation",
            "Looks for solution, excluding files in Documentation."
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 21,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "--cached",
                        "lines": 3,
                        "long": "--cached"
                    },
                    {
                        "name": "--no-index",
                        "lines": 2,
                        "long": "--no-index"
                    },
                    {
                        "name": "--untracked",
                        "lines": 3,
                        "long": "--untracked"
                    },
                    {
                        "name": "--no-exclude-standard",
                        "lines": 3,
                        "long": "--no-exclude-standard"
                    },
                    {
                        "name": "--exclude-standard",
                        "lines": 4,
                        "long": "--exclude-standard"
                    },
                    {
                        "name": "--recurse-submodules",
                        "lines": 6,
                        "long": "--recurse-submodules"
                    },
                    {
                        "name": "-a, --text",
                        "lines": 2,
                        "flag": "-a",
                        "long": "--text"
                    },
                    {
                        "name": "--textconv",
                        "lines": 2,
                        "long": "--textconv"
                    },
                    {
                        "name": "--no-textconv",
                        "lines": 2,
                        "long": "--no-textconv"
                    },
                    {
                        "name": "-i, --ignore-case",
                        "lines": 2,
                        "flag": "-i",
                        "long": "--ignore-case"
                    },
                    {
                        "name": "-I",
                        "lines": 2,
                        "flag": "-I"
                    },
                    {
                        "name": "--max-depth <depth>",
                        "lines": 6,
                        "long": "--max-depth",
                        "arg": "<depth>"
                    },
                    {
                        "name": "-r, --recursive",
                        "lines": 2,
                        "flag": "-r",
                        "long": "--recursive"
                    },
                    {
                        "name": "--no-recursive",
                        "lines": 2,
                        "long": "--no-recursive"
                    },
                    {
                        "name": "-w, --word-regexp",
                        "lines": 4,
                        "flag": "-w",
                        "long": "--word-regexp"
                    },
                    {
                        "name": "-v, --invert-match",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--invert-match"
                    },
                    {
                        "name": "-h, -H",
                        "lines": 5,
                        "flag": "-H"
                    },
                    {
                        "name": "--full-name",
                        "lines": 4,
                        "long": "--full-name"
                    },
                    {
                        "name": "-E, --extended-regexp, -G, --basic-regexp",
                        "lines": 3,
                        "flag": "-G",
                        "long": "--basic-regexp"
                    },
                    {
                        "name": "-P, --perl-regexp",
                        "lines": 6,
                        "flag": "-P",
                        "long": "--perl-regexp"
                    },
                    {
                        "name": "-F, --fixed-strings",
                        "lines": 3,
                        "flag": "-F",
                        "long": "--fixed-strings"
                    },
                    {
                        "name": "-n, --line-number",
                        "lines": 2,
                        "flag": "-n",
                        "long": "--line-number"
                    },
                    {
                        "name": "--column",
                        "lines": 3,
                        "long": "--column"
                    },
                    {
                        "name": "-l, --files-with-matches, --name-only, -L, --files-without-match",
                        "lines": 13,
                        "flag": "-L",
                        "long": "--files-without-match"
                    },
                    {
                        "name": "-z, --null",
                        "lines": 5,
                        "flag": "-z",
                        "long": "--null"
                    },
                    {
                        "name": "-o, --only-matching",
                        "lines": 3,
                        "flag": "-o",
                        "long": "--only-matching"
                    },
                    {
                        "name": "-c, --count",
                        "lines": 7,
                        "flag": "-c",
                        "long": "--count"
                    },
                    {
                        "name": "--no-color",
                        "lines": 3,
                        "long": "--no-color"
                    },
                    {
                        "name": "--break",
                        "lines": 2,
                        "long": "--break"
                    },
                    {
                        "name": "--heading",
                        "lines": 3,
                        "long": "--heading"
                    },
                    {
                        "name": "-p, --show-function",
                        "lines": 9,
                        "flag": "-p",
                        "long": "--show-function"
                    },
                    {
                        "name": "-A <num>, --after-context <num>",
                        "lines": 3,
                        "flag": "-A",
                        "long": "--after-context",
                        "arg": "<num>"
                    },
                    {
                        "name": "-B <num>, --before-context <num>",
                        "lines": 3,
                        "flag": "-B",
                        "long": "--before-context",
                        "arg": "<num>"
                    },
                    {
                        "name": "-W, --function-context",
                        "lines": 7,
                        "flag": "-W",
                        "long": "--function-context"
                    },
                    {
                        "name": "--threads <num>",
                        "lines": 3,
                        "long": "--threads",
                        "arg": "<num>"
                    },
                    {
                        "name": "-f <file>",
                        "lines": 19,
                        "flag": "-f",
                        "arg": "<file>"
                    },
                    {
                        "name": "-e",
                        "lines": 9,
                        "flag": "-e"
                    },
                    {
                        "name": "--all-match",
                        "lines": 4,
                        "long": "--all-match"
                    },
                    {
                        "name": "-q, --quiet",
                        "lines": 18,
                        "flag": "-q",
                        "long": "--quiet"
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "NOTES ON THREADS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "CONFIGURATION",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "git-grep - Print lines matching a pattern\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git grep [-a | --text] [-I] [--textconv] [-i | --ignore-case] [-w | --word-regexp]\n[-v | --invert-match] [-h|-H] [--full-name]\n[-E | --extended-regexp] [-G | --basic-regexp]\n[-P | --perl-regexp]\n[-F | --fixed-strings] [-n | --line-number] [--column]\n[-l | --files-with-matches] [-L | --files-without-match]\n[(-O | --open-files-in-pager) [<pager>]]\n[-z | --null]\n[ -o | --only-matching ] [-c | --count] [--all-match] [-q | --quiet]\n[--max-depth <depth>] [--[no-]recursive]\n[--color[=<when>] | --no-color]\n[--break] [--heading] [-p | --show-function]\n[-A <post-context>] [-B <pre-context>] [-C <context>]\n[-W | --function-context]\n[--threads <num>]\n[-f <file>] [-e] <pattern>\n[--and|--or|--not|(|)|-e <pattern>...]\n[--recurse-submodules] [--parent-basename <basename>]\n[ [--[no-]exclude-standard] [--cached | --no-index | --untracked] | <tree>...]\n[--] [<pathspec>...]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Look for specified patterns in the tracked files in the work tree,\nblobs registered in the index file, or blobs in given tree objects.\nPatterns are lists of one or more search expressions separated by\nnewline characters. An empty string as search expression matches all\nlines.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "--cached",
                        "content": "Instead of searching tracked files in the working tree, search\nblobs registered in the index file.\n",
                        "long": "--cached"
                    },
                    {
                        "name": "--no-index",
                        "content": "Search files in the current directory that is not managed by Git.\n",
                        "long": "--no-index"
                    },
                    {
                        "name": "--untracked",
                        "content": "In addition to searching in the tracked files in the working tree,\nsearch also in untracked files.\n",
                        "long": "--untracked"
                    },
                    {
                        "name": "--no-exclude-standard",
                        "content": "Also search in ignored files by not honoring the .gitignore\nmechanism. Only useful with --untracked.\n",
                        "long": "--no-exclude-standard"
                    },
                    {
                        "name": "--exclude-standard",
                        "content": "Do not pay attention to ignored files specified via the .gitignore\nmechanism. Only useful when searching files in the current\ndirectory with --no-index.\n",
                        "long": "--exclude-standard"
                    },
                    {
                        "name": "--recurse-submodules",
                        "content": "Recursively search in each submodule that is active and checked out\nin the repository. When used in combination with the <tree> option\nthe prefix of all submodule output will be the name of the parent\nproject's <tree> object. This option has no effect if --no-index is\ngiven.\n",
                        "long": "--recurse-submodules"
                    },
                    {
                        "name": "-a, --text",
                        "content": "Process binary files as if they were text.\n",
                        "flag": "-a",
                        "long": "--text"
                    },
                    {
                        "name": "--textconv",
                        "content": "Honor textconv filter settings.\n",
                        "long": "--textconv"
                    },
                    {
                        "name": "--no-textconv",
                        "content": "Do not honor textconv filter settings. This is the default.\n",
                        "long": "--no-textconv"
                    },
                    {
                        "name": "-i, --ignore-case",
                        "content": "Ignore case differences between the patterns and the files.\n",
                        "flag": "-i",
                        "long": "--ignore-case"
                    },
                    {
                        "name": "-I",
                        "content": "Don't match the pattern in binary files.\n",
                        "flag": "-I"
                    },
                    {
                        "name": "--max-depth <depth>",
                        "content": "For each <pathspec> given on command line, descend at most <depth>\nlevels of directories. A value of -1 means no limit. This option is\nignored if <pathspec> contains active wildcards. In other words if\n\"a*\" matches a directory named \"a*\", \"*\" is matched literally so\n--max-depth is still effective.\n",
                        "long": "--max-depth",
                        "arg": "<depth>"
                    },
                    {
                        "name": "-r, --recursive",
                        "content": "Same as --max-depth=-1; this is the default.\n",
                        "flag": "-r",
                        "long": "--recursive"
                    },
                    {
                        "name": "--no-recursive",
                        "content": "Same as --max-depth=0.\n",
                        "long": "--no-recursive"
                    },
                    {
                        "name": "-w, --word-regexp",
                        "content": "Match the pattern only at word boundary (either begin at the\nbeginning of a line, or preceded by a non-word character; end at\nthe end of a line or followed by a non-word character).\n",
                        "flag": "-w",
                        "long": "--word-regexp"
                    },
                    {
                        "name": "-v, --invert-match",
                        "content": "Select non-matching lines.\n",
                        "flag": "-v",
                        "long": "--invert-match"
                    },
                    {
                        "name": "-h, -H",
                        "content": "By default, the command shows the filename for each match.  -h\noption is used to suppress this output.  -H is there for\ncompleteness and does not do anything except it overrides -h given\nearlier on the command line.\n",
                        "flag": "-H"
                    },
                    {
                        "name": "--full-name",
                        "content": "When run from a subdirectory, the command usually outputs paths\nrelative to the current directory. This option forces paths to be\noutput relative to the project top directory.\n",
                        "long": "--full-name"
                    },
                    {
                        "name": "-E, --extended-regexp, -G, --basic-regexp",
                        "content": "Use POSIX extended/basic regexp for patterns. Default is to use\nbasic regexp.\n",
                        "flag": "-G",
                        "long": "--basic-regexp"
                    },
                    {
                        "name": "-P, --perl-regexp",
                        "content": "Use Perl-compatible regular expressions for patterns.\n\nSupport for these types of regular expressions is an optional\ncompile-time dependency. If Git wasn't compiled with support for\nthem providing this option will cause it to die.\n",
                        "flag": "-P",
                        "long": "--perl-regexp"
                    },
                    {
                        "name": "-F, --fixed-strings",
                        "content": "Use fixed strings for patterns (don't interpret pattern as a\nregex).\n",
                        "flag": "-F",
                        "long": "--fixed-strings"
                    },
                    {
                        "name": "-n, --line-number",
                        "content": "Prefix the line number to matching lines.\n",
                        "flag": "-n",
                        "long": "--line-number"
                    },
                    {
                        "name": "--column",
                        "content": "Prefix the 1-indexed byte-offset of the first match from the start\nof the matching line.\n",
                        "long": "--column"
                    },
                    {
                        "name": "-l, --files-with-matches, --name-only, -L, --files-without-match",
                        "content": "Instead of showing every matched line, show only the names of files\nthat contain (or do not contain) matches. For better compatibility\nwith git diff, --name-only is a synonym for --files-with-matches.\n\n-O[<pager>], --open-files-in-pager[=<pager>]\nOpen the matching files in the pager (not the output of grep). If\nthe pager happens to be \"less\" or \"vi\", and the user specified only\none pattern, the first file is positioned at the first match\nautomatically. The pager argument is optional; if specified, it\nmust be stuck to the option without a space. If pager is\nunspecified, the default pager will be used (see core.pager in git-\nconfig(1)).\n",
                        "flag": "-L",
                        "long": "--files-without-match"
                    },
                    {
                        "name": "-z, --null",
                        "content": "Use \\0 as the delimiter for pathnames in the output, and print them\nverbatim. Without this option, pathnames with \"unusual\" characters\nare quoted as explained for the configuration variable\ncore.quotePath (see git-config(1)).\n",
                        "flag": "-z",
                        "long": "--null"
                    },
                    {
                        "name": "-o, --only-matching",
                        "content": "Print only the matched (non-empty) parts of a matching line, with\neach such part on a separate output line.\n",
                        "flag": "-o",
                        "long": "--only-matching"
                    },
                    {
                        "name": "-c, --count",
                        "content": "Instead of showing every matched line, show the number of lines\nthat match.\n\n--color[=<when>]\nShow colored matches. The value must be always (the default),\nnever, or auto.\n",
                        "flag": "-c",
                        "long": "--count"
                    },
                    {
                        "name": "--no-color",
                        "content": "Turn off match highlighting, even when the configuration file gives\nthe default to color output. Same as --color=never.\n",
                        "long": "--no-color"
                    },
                    {
                        "name": "--break",
                        "content": "Print an empty line between matches from different files.\n",
                        "long": "--break"
                    },
                    {
                        "name": "--heading",
                        "content": "Show the filename above the matches in that file instead of at the\nstart of each shown line.\n",
                        "long": "--heading"
                    },
                    {
                        "name": "-p, --show-function",
                        "content": "Show the preceding line that contains the function name of the\nmatch, unless the matching line is a function name itself. The name\nis determined in the same way as git diff works out patch hunk\nheaders (see Defining a custom hunk-header in gitattributes(5)).\n\n-<num>, -C <num>, --context <num>\nShow <num> leading and trailing lines, and place a line containing\n-- between contiguous groups of matches.\n",
                        "flag": "-p",
                        "long": "--show-function"
                    },
                    {
                        "name": "-A <num>, --after-context <num>",
                        "content": "Show <num> trailing lines, and place a line containing -- between\ncontiguous groups of matches.\n",
                        "flag": "-A",
                        "long": "--after-context",
                        "arg": "<num>"
                    },
                    {
                        "name": "-B <num>, --before-context <num>",
                        "content": "Show <num> leading lines, and place a line containing -- between\ncontiguous groups of matches.\n",
                        "flag": "-B",
                        "long": "--before-context",
                        "arg": "<num>"
                    },
                    {
                        "name": "-W, --function-context",
                        "content": "Show the surrounding text from the previous line containing a\nfunction name up to the one before the next function name,\neffectively showing the whole function in which the match was\nfound. The function names are determined in the same way as git\ndiff works out patch hunk headers (see Defining a custom\nhunk-header in gitattributes(5)).\n",
                        "flag": "-W",
                        "long": "--function-context"
                    },
                    {
                        "name": "--threads <num>",
                        "content": "Number of grep worker threads to use. See grep.threads in\nCONFIGURATION for more information.\n",
                        "long": "--threads",
                        "arg": "<num>"
                    },
                    {
                        "name": "-f <file>",
                        "content": "Read patterns from <file>, one per line.\n\nPassing the pattern via <file> allows for providing a search\npattern containing a \\0.\n\nNot all pattern types support patterns containing \\0. Git will\nerror out if a given pattern type can't support such a pattern. The\n--perl-regexp pattern type when compiled against the PCRE v2\nbackend has the widest support for these types of patterns.\n\nIn versions of Git before 2.23.0 patterns containing \\0 would be\nsilently considered fixed. This was never documented, there were\nalso odd and undocumented interactions between e.g. non-ASCII\npatterns containing \\0 and --ignore-case.\n\nIn future versions we may learn to support patterns containing \\0\nfor more search backends, until then we'll die when the pattern\ntype in question doesn't support them.\n",
                        "flag": "-f",
                        "arg": "<file>"
                    },
                    {
                        "name": "-e",
                        "content": "The next parameter is the pattern. This option has to be used for\npatterns starting with - and should be used in scripts passing user\ninput to grep. Multiple patterns are combined by or.\n\n--and, --or, --not, ( ... )\nSpecify how multiple patterns are combined using Boolean\nexpressions.  --or is the default operator.  --and has higher\nprecedence than --or.  -e has to be used for all patterns.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "--all-match",
                        "content": "When giving multiple pattern expressions combined with --or, this\nflag is specified to limit the match to files that have lines to\nmatch all of them.\n",
                        "long": "--all-match"
                    },
                    {
                        "name": "-q, --quiet",
                        "content": "Do not output matched lines; instead, exit with status 0 when there\nis a match and with non-zero status when there isn't.\n\n<tree>...\nInstead of searching tracked files in the working tree, search\nblobs in the given trees.\n\n--\nSignals the end of options; the rest of the parameters are\n<pathspec> limiters.\n\n<pathspec>...\nIf given, limit the search to paths matching at least one pattern.\nBoth leading paths match and glob(7) patterns are supported.\n\nFor more details about the <pathspec> syntax, see the pathspec\nentry in gitglossary(7).\n",
                        "flag": "-q",
                        "long": "--quiet"
                    }
                ]
            },
            "EXAMPLES": {
                "content": "git grep 'timet' -- '*.[ch]'\nLooks for timet in all tracked .c and .h files in the working\ndirectory and its subdirectories.\n\ngit grep -e '#define' --and \\( -e MAXPATH -e PATHMAX \\)\nLooks for a line that has #define and either MAXPATH or PATHMAX.\n\ngit grep --all-match -e NODE -e Unexpected\nLooks for a line that has NODE or Unexpected in files that have\nlines that match both.\n\ngit grep solution -- :^Documentation\nLooks for solution, excluding files in Documentation.\n",
                "subsections": []
            },
            "NOTES ON THREADS": {
                "content": "The --threads option (and the grep.threads configuration) will be\nignored when --open-files-in-pager is used, forcing a single-threaded\nexecution.\n\nWhen grepping the object store (with --cached or giving tree objects),\nrunning with multiple threads might perform slower than single threaded\nif --textconv is given and there're too many text conversions. So if\nyou experience low performance in this case, it might be desirable to\nuse --threads=1.\n",
                "subsections": []
            },
            "CONFIGURATION": {
                "content": "grep.lineNumber\nIf set to true, enable -n option by default.\n\ngrep.column\nIf set to true, enable the --column option by default.\n\ngrep.patternType\nSet the default matching behavior. Using a value of basic,\nextended, fixed, or perl will enable the --basic-regexp,\n--extended-regexp, --fixed-strings, or --perl-regexp option\naccordingly, while the value default will return to the default\nmatching behavior.\n\ngrep.extendedRegexp\nIf set to true, enable --extended-regexp option by default. This\noption is ignored when the grep.patternType option is set to a\nvalue other than default.\n\ngrep.threads\nNumber of grep worker threads to use. If unset (or set to 0), Git\nwill use as many threads as the number of logical cores available.\n\ngrep.fullName\nIf set to true, enable --full-name option by default.\n\ngrep.fallbackToNoIndex\nIf set to true, fall back to git grep --no-index if git grep is\nexecuted outside of a git repository. Defaults to false.\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n\nGit 2.34.1                        02/26/2026                       GIT-GREP(1)",
                "subsections": []
            }
        }
    }
}