зеркало из https://github.com/microsoft/git.git
Merge branch 'ml/maint-grep-doc'
* ml/maint-grep-doc: grep docs: document --no-index option grep docs: --cached and <tree>... are incompatible grep docs: use AsciiDoc literals consistently grep docs: pluralize "Example" section
This commit is contained in:
Коммит
3fea3139c2
|
@ -9,8 +9,7 @@ git-grep - Print lines matching a pattern
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
[verse]
|
[verse]
|
||||||
'git grep' [--cached]
|
'git grep' [-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp]
|
||||||
[-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp]
|
|
||||||
[-v | --invert-match] [-h|-H] [--full-name]
|
[-v | --invert-match] [-h|-H] [--full-name]
|
||||||
[-E | --extended-regexp] [-G | --basic-regexp]
|
[-E | --extended-regexp] [-G | --basic-regexp]
|
||||||
[-F | --fixed-strings] [-n]
|
[-F | --fixed-strings] [-n]
|
||||||
|
@ -21,7 +20,8 @@ SYNOPSIS
|
||||||
[--color[=<when>] | --no-color]
|
[--color[=<when>] | --no-color]
|
||||||
[-A <post-context>] [-B <pre-context>] [-C <context>]
|
[-A <post-context>] [-B <pre-context>] [-C <context>]
|
||||||
[-f <file>] [-e] <pattern>
|
[-f <file>] [-e] <pattern>
|
||||||
[--and|--or|--not|(|)|-e <pattern>...] [<tree>...]
|
[--and|--or|--not|(|)|-e <pattern>...]
|
||||||
|
[--cached | --no-index | <tree>...]
|
||||||
[--] [<pathspec>...]
|
[--] [<pathspec>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
@ -33,8 +33,11 @@ registered in the index file, or blobs in given tree objects.
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-------
|
-------
|
||||||
--cached::
|
--cached::
|
||||||
Instead of searching in the working tree files, check
|
Instead of searching tracked files in the working tree, search
|
||||||
the blobs registered in the index file.
|
blobs registered in the index file.
|
||||||
|
|
||||||
|
--no-index::
|
||||||
|
Search files in the current directory, not just those tracked by git.
|
||||||
|
|
||||||
-a::
|
-a::
|
||||||
--text::
|
--text::
|
||||||
|
@ -98,8 +101,8 @@ OPTIONS
|
||||||
--files-without-match::
|
--files-without-match::
|
||||||
Instead of showing every matched line, show only the
|
Instead of showing every matched line, show only the
|
||||||
names of files that contain (or do not contain) matches.
|
names of files that contain (or do not contain) matches.
|
||||||
For better compatibility with 'git diff', --name-only is a
|
For better compatibility with 'git diff', `--name-only` is a
|
||||||
synonym for --files-with-matches.
|
synonym for `--files-with-matches`.
|
||||||
|
|
||||||
-z::
|
-z::
|
||||||
--null::
|
--null::
|
||||||
|
@ -127,7 +130,7 @@ OPTIONS
|
||||||
matches.
|
matches.
|
||||||
|
|
||||||
-<num>::
|
-<num>::
|
||||||
A shortcut for specifying -C<num>.
|
A shortcut for specifying `-C<num>`.
|
||||||
|
|
||||||
-p::
|
-p::
|
||||||
--show-function::
|
--show-function::
|
||||||
|
@ -142,7 +145,7 @@ OPTIONS
|
||||||
|
|
||||||
-e::
|
-e::
|
||||||
The next parameter is the pattern. This option has to be
|
The next parameter is the pattern. This option has to be
|
||||||
used for patterns starting with - and should be used in
|
used for patterns starting with `-` and should be used in
|
||||||
scripts passing user input to grep. Multiple patterns are
|
scripts passing user input to grep. Multiple patterns are
|
||||||
combined by 'or'.
|
combined by 'or'.
|
||||||
|
|
||||||
|
@ -165,8 +168,9 @@ OPTIONS
|
||||||
Do not output matched lines; instead, exit with status 0 when
|
Do not output matched lines; instead, exit with status 0 when
|
||||||
there is a match and with non-zero status when there isn't.
|
there is a match and with non-zero status when there isn't.
|
||||||
|
|
||||||
`<tree>...`::
|
<tree>...::
|
||||||
Search blobs in the trees for specified patterns.
|
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
|
Signals the end of options; the rest of the parameters
|
||||||
|
@ -176,8 +180,8 @@ OPTIONS
|
||||||
If given, limit the search to paths matching at least one pattern.
|
If given, limit the search to paths matching at least one pattern.
|
||||||
Both leading paths match and glob(7) patterns are supported.
|
Both leading paths match and glob(7) patterns are supported.
|
||||||
|
|
||||||
Example
|
Examples
|
||||||
-------
|
--------
|
||||||
|
|
||||||
git grep 'time_t' -- '*.[ch]'::
|
git grep 'time_t' -- '*.[ch]'::
|
||||||
Looks for `time_t` in all tracked .c and .h files in the working
|
Looks for `time_t` in all tracked .c and .h files in the working
|
||||||
|
|
Загрузка…
Ссылка в новой задаче