table of contents
GIT-GREP(1) | Git Manual | GIT-GREP(1) |
NAME¶
git-grep - Print lines matching a pattern
SYNOPSIS¶
git grep [-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp]
[-v | --invert-match] [-h|-H] [--full-name]
[-E | --extended-regexp] [-G | --basic-regexp]
[-F | --fixed-strings] [-n]
[-l | --files-with-matches] [-L | --files-without-match]
[-z | --null]
[-c | --count] [--all-match] [-q | --quiet]
[--max-depth <depth>]
[--color[=<when>] | --no-color]
[-A <post-context>] [-B <pre-context>] [-C <context>]
[-f <file>] [-e] <pattern>
[--and|--or|--not|(|)|-e <pattern>...]
[--cached | --no-index | <tree>...]
[--] [<pathspec>...]
DESCRIPTION¶
Look for specified patterns in the tracked files in the work tree, blobs registered in the index file, or blobs in given tree objects.
OPTIONS¶
--cached
--no-index
-a, --text
-i, --ignore-case
-I
--max-depth <depth>
-w, --word-regexp
-v, --invert-match
-h, -H
--full-name
-E, --extended-regexp, -G, --basic-regexp
-F, --fixed-strings
-n
-l, --files-with-matches, --name-only, -L, --files-without-match
-z, --null
-c, --count
--color[=<when>]
--no-color
-[ABC] <context>
— before), or both (C — context) lines, and place a line containing -- between contiguous groups of matches.
-<num>
-p, --show-function
-f <file>
-e
--and, --or, --not, ( ... )
--all-match
-q, --quiet
<tree>...
--
<pathspec>...
EXAMPLES¶
git grep time_t — *.[ch]
git grep -e ´#define\´ --and \( -e MAX_PATH -e PATH_MAX \)
git grep --all-match -e NODE -e Unexpected
AUTHOR¶
Originally written by Linus Torvalds <torvalds@osdl.org[1]>, later revamped by Junio C Hamano.
DOCUMENTATION¶
Documentation by Junio C Hamano and the git-list <git@vger.kernel.org[2]>.
GIT¶
Part of the git(1) suite
NOTES¶
- 1.
- torvalds@osdl.org
- 2.
- git@vger.kernel.org
02/03/2020 | Git 1.7.1 |