8d0b7202b3f35a1f67fd1c8459378af80372ce04
[git.git] / man1 / git-grep.1
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .de Sh \" Subsection
3 .br
4 .if t .Sp
5 .ne 5
6 .PP
7 \fB\\$1\fR
8 .PP
9 ..
10 .de Sp \" Vertical space (when we can't use .PP)
11 .if t .sp .5v
12 .if n .sp
13 ..
14 .de Ip \" List item
15 .br
16 .ie \\n(.$>=3 .ne \\$3
17 .el .ne 3
18 .IP "\\$1" \\$2
19 ..
20 .TH "GIT-GREP" 1 "" "" ""
21 .SH NAME
22 git-grep \- Print lines matching a pattern
23 .SH "SYNOPSIS"
24
25 .nf
26 \fIgit\-grep\fR [\-\-cached]
27            [\-a | \-\-text] [\-I] [\-i | \-\-ignore\-case] [\-w | \-\-word\-regexp]
28            [\-v | \-\-invert\-match]
29            [\-E | \-\-extended\-regexp] [\-G | \-\-basic\-regexp] [\-F | \-\-fixed\-strings]
30            [\-n] [\-l | \-\-files\-with\-matches] [\-L | \-\-files\-without\-match]
31            [\-c | \-\-count]
32            [\-A <post\-context>] [\-B <pre\-context>] [\-C <context>]
33            [\-f <file>] [\-e <pattern>]
34            [<tree>...]
35            [\-\-] [<path>...]
36 .fi
37
38 .SH "DESCRIPTION"
39
40
41 Look for specified patterns in the working tree files, blobs registered in the index file, or given tree objects\&.
42
43 .SH "OPTIONS"
44
45 .TP
46 \-\-cached
47 Instead of searching in the working tree files, check the blobs registerd in the index file\&.
48
49 .TP
50 \-a | \-\-text
51 Process binary files as if they were text\&.
52
53 .TP
54 \-i | \-\-ignore\-case
55 Ignore case differences between the patterns and the files\&.
56
57 .TP
58 \-w | \-\-word\-regexp
59 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)\&.
60
61 .TP
62 \-v | \-\-invert\-match
63 Select non\-matching lines\&.
64
65 .TP
66 \-E | \-\-extended\-regexp | \-G | \-\-basic\-regexp
67 Use POSIX extended/basic regexp for patterns\&. Default is to use basic regexp\&.
68
69 .TP
70 \-n
71 Prefix the line number to matching lines\&.
72
73 .TP
74 \-l | \-\-files\-with\-matches | \-L | \-\-files\-without\-match
75 Instead of showing every matched line, show only the names of files that contain (or do not contain) matches\&.
76
77 .TP
78 \-c | \-\-count
79 Instead of showing every matched line, show the number of lines that match\&.
80
81 .TP
82 \-[ABC] <context>
83 Show context trailing (A -- after), or leading (B -- before), or both (C -- context) lines, and place a line containing \-\- between continguous groups of matches\&.
84
85 .TP
86 \-f <file>
87 Read patterns from <file>, one per line\&.
88
89 .TP
90 <tree>...
91 Search blobs in the trees for specified patterns\&.
92
93 .TP
94 \-\-
95 Signals the end of options; the rest of the parameters are <path> limiters\&.
96
97 .SH "AUTHOR"
98
99
100 Originally written by Linus Torvalds <torvalds@osdl\&.org>, later revamped by Junio C Hamano\&.
101
102 .SH "DOCUMENTATION"
103
104
105 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
106
107 .SH "GIT"
108
109
110 Part of the \fBgit\fR(7) suite
111