2005-09-13 04:39:15 +02:00
|
|
|
git-grep(1)
|
|
|
|
===========
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2006-03-09 17:24:37 +01:00
|
|
|
git-grep - Print lines matching a pattern
|
2005-09-13 04:39:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2006-05-08 22:28:49 +02:00
|
|
|
[verse]
|
|
|
|
'git-grep' [--cached]
|
|
|
|
[-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp]
|
|
|
|
[-v | --invert-match]
|
2006-05-10 03:28:41 +02:00
|
|
|
[-E | --extended-regexp] [-G | --basic-regexp] [-F | --fixed-strings]
|
2006-05-08 22:28:49 +02:00
|
|
|
[-n] [-l | --files-with-matches] [-L | --files-without-match]
|
|
|
|
[-c | --count]
|
|
|
|
[-A <post-context>] [-B <pre-context>] [-C <context>]
|
|
|
|
[-f <file>] [-e <pattern>]
|
|
|
|
[<tree>...]
|
|
|
|
[--] [<path>...]
|
2005-09-13 04:39:15 +02:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2006-05-08 22:28:49 +02:00
|
|
|
Look for specified patterns in the working tree files, blobs
|
|
|
|
registered in the index file, or given tree objects.
|
2005-09-13 04:39:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
2006-05-08 22:28:49 +02:00
|
|
|
--cached::
|
|
|
|
Instead of searching in the working tree files, check
|
|
|
|
the blobs registerd in the index file.
|
|
|
|
|
|
|
|
-a | --text::
|
|
|
|
Process binary files as if they were text.
|
|
|
|
|
|
|
|
-i | --ignore-case::
|
|
|
|
Ignore case differences between the patterns and the
|
|
|
|
files.
|
|
|
|
|
|
|
|
-w | --word-regexp::
|
|
|
|
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).
|
|
|
|
|
|
|
|
-v | --invert-match::
|
|
|
|
Select non-matching lines.
|
|
|
|
|
|
|
|
-E | --extended-regexp | -G | --basic-regexp::
|
|
|
|
Use POSIX extended/basic regexp for patterns. Default
|
|
|
|
is to use basic regexp.
|
2006-01-21 00:00:12 +01:00
|
|
|
|
2006-05-08 22:28:49 +02:00
|
|
|
-n::
|
|
|
|
Prefix the line number to matching lines.
|
2005-09-13 04:39:15 +02:00
|
|
|
|
2006-05-08 22:28:49 +02:00
|
|
|
-l | --files-with-matches | -L | --files-without-match::
|
|
|
|
Instead of showing every matched line, show only the
|
|
|
|
names of files that contain (or do not contain) matches.
|
2005-09-13 04:39:15 +02:00
|
|
|
|
2006-05-08 22:28:49 +02:00
|
|
|
-c | --count::
|
|
|
|
Instead of showing every matched line, show the number of
|
|
|
|
lines that match.
|
|
|
|
|
|
|
|
-[ABC] <context>::
|
|
|
|
Show `context` trailing (`A` -- after), or leading (`B`
|
|
|
|
-- before), or both (`C` -- context) lines, and place a
|
|
|
|
line containing `--` between continguous groups of
|
|
|
|
matches.
|
|
|
|
|
|
|
|
-f <file>::
|
|
|
|
Read patterns from <file>, one per line.
|
|
|
|
|
|
|
|
`<tree>...`::
|
|
|
|
Search blobs in the trees for specified patterns.
|
|
|
|
|
|
|
|
`--`::
|
|
|
|
Signals the end of options; the rest of the parameters
|
|
|
|
are <path> limiters.
|
2005-09-13 04:39:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
Author
|
|
|
|
------
|
2006-05-08 22:28:49 +02:00
|
|
|
Originally written by Linus Torvalds <torvalds@osdl.org>, later
|
|
|
|
revamped by Junio C Hamano.
|
|
|
|
|
2005-09-13 04:39:15 +02:00
|
|
|
|
|
|
|
Documentation
|
|
|
|
--------------
|
|
|
|
Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
|
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
2005-09-19 12:10:51 +02:00
|
|
|
Part of the gitlink:git[7] suite
|
2005-09-13 04:39:15 +02:00
|
|
|
|