blob: 3922c835d9827f6b1b9dfe13bdbee3fb0bd49925 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamano7bd050f2011-09-22 06:32:226<meta name="generator" content="AsciiDoc 8.5.2" />
Junio C Hamano103b5722011-01-31 05:03:457<title>git-grep(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
9/* Debug borders */
10p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11/*
12 border: 1px solid red;
13*/
14}
15
16body {
17 margin: 1em 5% 1em 5%;
18}
19
Junio C Hamanoba4b9282008-07-06 05:20:3120a {
21 color: blue;
22 text-decoration: underline;
23}
24a:visited {
25 color: fuchsia;
26}
Junio C Hamano1a4e8412005-12-27 08:17:2327
28em {
29 font-style: italic;
Junio C Hamano103b5722011-01-31 05:03:4530 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2331}
32
33strong {
34 font-weight: bold;
Junio C Hamano103b5722011-01-31 05:03:4535 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2336}
37
38tt {
39 color: navy;
40}
41
42h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
48}
49
Junio C Hamanoba4b9282008-07-06 05:20:3150h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 border-bottom: 2px solid silver;
52}
53h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2354 padding-top: 0.5em;
55}
Junio C Hamanoba4b9282008-07-06 05:20:3156h3 {
57 float: left;
58}
59h3 + * {
60 clear: left;
61}
Junio C Hamano1a4e8412005-12-27 08:17:2362
63div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
66}
67
68hr {
69 border: 1px solid silver;
70}
71
72p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
75}
76
Junio C Hamano103b5722011-01-31 05:03:4577ul, ol, li > p {
78 margin-top: 0;
79}
80
Junio C Hamano1a4e8412005-12-27 08:17:2381pre {
82 padding: 0;
83 margin: 0;
84}
85
86span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3190 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2391}
92span#email {
93}
Junio C Hamano103b5722011-01-31 05:03:4594span#revnumber, span#revdate, span#revremark {
Junio C Hamano1a4e8412005-12-27 08:17:2395 font-family: sans-serif;
96}
97
98div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
104}
105div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
108}
109div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
112}
113
Junio C Hamano103b5722011-01-31 05:03:45114div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
117}
Junio C Hamano1a4e8412005-12-27 08:17:23118div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22121 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23122 margin-bottom: 1.5em;
123}
124div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23129}
130
131div.content { /* Block element content. */
132 padding: 0;
133}
134
135/* Block element titles. */
136div.title, caption.title {
Junio C Hamano103b5722011-01-31 05:03:45137 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
143}
144div.title + * {
145 margin-top: 0;
146}
147
148td div.title:first-child {
149 margin-top: 0.0em;
150}
151div.content div.title:first-child {
152 margin-top: 0.0em;
153}
154div.content + div.title {
155 margin-top: 0.0em;
156}
157
158div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
162}
163
164div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
168}
169
Junio C Hamano7bd050f2011-09-22 06:32:22170div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
Junio C Hamano103b5722011-01-31 05:03:45173 margin-right: 10%;
Junio C Hamano7bd050f2011-09-22 06:32:22174 border-left: 5px solid #dddddd;
175 color: #777777;
Junio C Hamano1a4e8412005-12-27 08:17:23176}
Junio C Hamano7bd050f2011-09-22 06:32:22177
Junio C Hamano103b5722011-01-31 05:03:45178div.quoteblock > div.attribution {
179 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23180 text-align: right;
181}
Junio C Hamano103b5722011-01-31 05:03:45182
Junio C Hamano103b5722011-01-31 05:03:45183div.verseblock > div.content {
184 white-space: pre;
185}
186div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
189}
190/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31191div.verseblock + div.attribution {
192 text-align: left;
193}
Junio C Hamano1a4e8412005-12-27 08:17:23194
195div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
202}
203div.admonitionblock td.content {
204 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22205 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23206}
207
208div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23211}
212
Junio C Hamano1a4e8412005-12-27 08:17:23213div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23214span.image img { border-style: none; }
Junio C Hamano103b5722011-01-31 05:03:45215a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23216
217dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
220}
221dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
Junio C Hamano103b5722011-01-31 05:03:45224 font-style: normal;
225 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23226}
227dd > *:first-child {
Junio C Hamano103b5722011-01-31 05:03:45228 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23229}
230
231ul, ol {
232 list-style-position: outside;
233}
Junio C Hamano103b5722011-01-31 05:03:45234ol.arabic {
235 list-style-type: decimal;
236}
237ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23238 list-style-type: lower-alpha;
239}
Junio C Hamano103b5722011-01-31 05:03:45240ol.upperalpha {
241 list-style-type: upper-alpha;
242}
243ol.lowerroman {
244 list-style-type: lower-roman;
245}
246ol.upperroman {
247 list-style-type: upper-roman;
248}
249
250div.compact ul, div.compact ol,
251div.compact p, div.compact p,
252div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
255}
Junio C Hamano1a4e8412005-12-27 08:17:23256
257div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31258 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23259}
Junio C Hamano7bd050f2011-09-22 06:32:22260thead, p.table.header {
Junio C Hamano1a4e8412005-12-27 08:17:23261 font-family: sans-serif;
262 font-weight: bold;
263}
264tfoot {
265 font-weight: bold;
266}
Junio C Hamano103b5722011-01-31 05:03:45267td > div.verse {
268 white-space: pre;
269}
270p.table {
271 margin-top: 0;
272}
273/* Because the table frame attribute is overriden by CSS in most browsers. */
274div.tableblock > table[frame="void"] {
275 border-style: none;
276}
277div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
280}
281div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
284}
Junio C Hamano1a4e8412005-12-27 08:17:23285
Junio C Hamano103b5722011-01-31 05:03:45286
287div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
290}
Junio C Hamano103b5722011-01-31 05:03:45291div.hdlist tr {
292 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31293}
Junio C Hamano103b5722011-01-31 05:03:45294dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
296}
297td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23298 vertical-align: top;
Junio C Hamano103b5722011-01-31 05:03:45299 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23300 padding-right: 0.8em;
Junio C Hamano103b5722011-01-31 05:03:45301 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23302}
Junio C Hamano103b5722011-01-31 05:03:45303td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23304 vertical-align: top;
305}
Junio C Hamano103b5722011-01-31 05:03:45306div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
309}
310
311.comment {
312 background: yellow;
313}
Junio C Hamano1a4e8412005-12-27 08:17:23314
Junio C Hamano7bd050f2011-09-22 06:32:22315.footnote, .footnoteref {
316 font-size: 0.8em;
317}
318
319span.footnote, span.footnoteref {
320 vertical-align: super;
321}
322
323#footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
326}
327
328#footnotes div.footnote {
329 margin: 0 0 5px 0;
330}
331
332#footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
340}
341
342
Junio C Hamano1a4e8412005-12-27 08:17:23343@media print {
344 div#footer-badges { display: none; }
345}
Junio C Hamanoba4b9282008-07-06 05:20:31346
Junio C Hamano7bd050f2011-09-22 06:32:22347div#toc {
348 margin-bottom: 2.5em;
349}
350
Junio C Hamanoba4b9282008-07-06 05:20:31351div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
358}
359
360div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
363}
364div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
367}
368div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
371}
372div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
375}
Junio C Hamano103b5722011-01-31 05:03:45376/* Overrides for manpage documents */
377h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
382}
383h2 {
384 border-style: none;
385}
386div.sectionbody {
387 margin-left: 5%;
388}
389
390@media print {
391 div#toc { display: none; }
392}
393
Junio C Hamano1a4e8412005-12-27 08:17:23394/* Workarounds for IE6's broken and incomplete CSS2. */
395
396div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
400}
401div.sidebar-title, div.image-title {
Junio C Hamano103b5722011-01-31 05:03:45402 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
407}
408
409div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
413}
414
Junio C Hamano103b5722011-01-31 05:03:45415div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
418}
419
420div.verseblock-content {
421 white-space: pre;
422}
423div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
Junio C Hamano1a4e8412005-12-27 08:17:23426}
427
428div.exampleblock-content {
Junio C Hamano7bd050f2011-09-22 06:32:22429 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23430 padding-left: 0.5em;
431}
Junio C Hamanoba4b9282008-07-06 05:20:31432
433/* IE6 sets dynamically generated links as visited. */
434div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23435</style>
Junio C Hamano7bd050f2011-09-22 06:32:22436<script type="text/javascript">
437/*<![CDATA[*/
438window.onload = function(){asciidoc.footnotes();}
439var asciidoc = { // Namespace.
440
441/////////////////////////////////////////////////////////////////////
442// Table Of Contents generator
443/////////////////////////////////////////////////////////////////////
444
445/* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
447 *
448 * Table Of Content generator
449 * Version: 0.4
450 *
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
453 */
454
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
457
458// toclevels = 1..4.
459toc: function (toclevels) {
460
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
468 }
469 return text;
470 }
471
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
476 }
477
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
490 }
491 iterate(i);
492 }
493 }
494 }
495 iterate(el);
496 return result;
497 }
498
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
512 }
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
515},
516
517
518/////////////////////////////////////////////////////////////////////
519// Footnotes generator
520/////////////////////////////////////////////////////////////////////
521
522/* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
524 */
525
526footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
547 }
548 }
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
561 }
562 }
563 }
564}
565
566}
567/*]]>*/
568</script>
Junio C Hamano1a4e8412005-12-27 08:17:23569</head>
570<body>
571<div id="header">
572<h1>
573git-grep(1) Manual Page
574</h1>
575<h2>NAME</h2>
576<div class="sectionbody">
577<p>git-grep -
Junio C Hamano01078922006-03-10 00:31:47578 Print lines matching a pattern
Junio C Hamano1a4e8412005-12-27 08:17:23579</p>
580</div>
581</div>
Junio C Hamano7bd050f2011-09-22 06:32:22582<div id="content">
Junio C Hamano103b5722011-01-31 05:03:45583<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23584<div class="sectionbody">
Junio C Hamano617fdb82006-05-16 02:14:21585<div class="verseblock">
Junio C Hamano103b5722011-01-31 05:03:45586<div class="verseblock-content"><em>git grep</em> [-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp]
Junio C Hamano97efb002006-09-16 18:16:04587 [-v | --invert-match] [-h|-H] [--full-name]
Junio C Hamano9882a522007-04-27 08:22:22588 [-E | --extended-regexp] [-G | --basic-regexp]
Junio C Hamano084228c2011-05-30 08:13:52589 [-P | --perl-regexp]
590 [-F | --fixed-strings] [-n | --line-number]
Junio C Hamano9882a522007-04-27 08:22:22591 [-l | --files-with-matches] [-L | --files-without-match]
Junio C Hamano7d449522010-07-01 00:08:51592 [(-O | --open-files-in-pager) [&lt;pager&gt;]]
Junio C Hamanoa476efa2008-10-10 15:31:42593 [-z | --null]
Junio C Hamano83b35472010-01-29 05:02:13594 [-c | --count] [--all-match] [-q | --quiet]
Junio C Hamano9f883862009-08-11 06:23:52595 [--max-depth &lt;depth&gt;]
Junio C Hamano4aa0bcc2010-03-03 05:13:12596 [--color[=&lt;when&gt;] | --no-color]
Junio C Hamano617fdb82006-05-16 02:14:21597 [-A &lt;post-context&gt;] [-B &lt;pre-context&gt;] [-C &lt;context&gt;]
Junio C Hamano9882a522007-04-27 08:22:22598 [-f &lt;file&gt;] [-e] &lt;pattern&gt;
Junio C Hamano636c8b22010-03-07 22:25:17599 [--and|--or|--not|(|)|-e &lt;pattern&gt;&#8230;]
Junio C Hamano5a73f302011-10-14 05:58:34600 [ [--exclude-standard] [--cached | --no-index | --untracked] | &lt;tree&gt;&#8230;]
Junio C Hamano103b5722011-01-31 05:03:45601 [--] [&lt;pathspec&gt;&#8230;]</div>
602<div class="verseblock-attribution">
603</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23604</div>
Junio C Hamanoba4b9282008-07-06 05:20:31605<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23606<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45607<div class="paragraph"><p>Look for specified patterns in the tracked files in the work tree, blobs
Junio C Hamano74a198f2010-02-22 00:13:31608registered in the index file, or blobs in given tree objects.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23609</div>
Junio C Hamanoa03ac862011-04-02 04:32:29610<h2 id="_configuration">CONFIGURATION</h2>
611<div class="sectionbody">
612<div class="dlist"><dl>
613<dt class="hdlist1">
614grep.lineNumber
615</dt>
616<dd>
617<p>
618 If set to true, enable <em>-n</em> option by default.
619</p>
620</dd>
621<dt class="hdlist1">
622grep.extendedRegexp
623</dt>
624<dd>
625<p>
626 If set to true, enable <em>--extended-regexp</em> option by default.
627</p>
628</dd>
629</dl></div>
630</div>
Junio C Hamanoba4b9282008-07-06 05:20:31631<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23632<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45633<div class="dlist"><dl>
634<dt class="hdlist1">
Junio C Hamano617fdb82006-05-16 02:14:21635--cached
636</dt>
637<dd>
638<p>
Junio C Hamano636c8b22010-03-07 22:25:17639 Instead of searching tracked files in the working tree, search
640 blobs registered in the index file.
641</p>
642</dd>
Junio C Hamano103b5722011-01-31 05:03:45643<dt class="hdlist1">
Junio C Hamano636c8b22010-03-07 22:25:17644--no-index
645</dt>
646<dd>
647<p>
Junio C Hamano5a73f302011-10-14 05:58:34648 Search files in the current directory that is not managed by git.
649</p>
650</dd>
651<dt class="hdlist1">
652--untracked
653</dt>
654<dd>
655<p>
656 In addition to searching in the tracked files in the working
657 tree, search also in untracked files.
658</p>
659</dd>
660<dt class="hdlist1">
661--no-exclude-standard
662</dt>
663<dd>
664<p>
665 Also search in ignored files by not honoring the <tt>.gitignore</tt>
666 mechanism. Only useful with <tt>--untracked</tt>.
667</p>
668</dd>
669<dt class="hdlist1">
670--exclude-standard
671</dt>
672<dd>
673<p>
674 Do not pay attention to ignored files specified via the <tt>.gitignore</tt>
675 mechanism. Only useful when searching files in the current directory
676 with <tt>--no-index</tt>.
Junio C Hamano617fdb82006-05-16 02:14:21677</p>
678</dd>
Junio C Hamano103b5722011-01-31 05:03:45679<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47680-a
681</dt>
Junio C Hamano103b5722011-01-31 05:03:45682<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47683--text
Junio C Hamano617fdb82006-05-16 02:14:21684</dt>
685<dd>
686<p>
687 Process binary files as if they were text.
688</p>
689</dd>
Junio C Hamano103b5722011-01-31 05:03:45690<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47691-i
692</dt>
Junio C Hamano103b5722011-01-31 05:03:45693<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47694--ignore-case
Junio C Hamano617fdb82006-05-16 02:14:21695</dt>
696<dd>
697<p>
698 Ignore case differences between the patterns and the
699 files.
700</p>
701</dd>
Junio C Hamano103b5722011-01-31 05:03:45702<dt class="hdlist1">
Junio C Hamano9882a522007-04-27 08:22:22703-I
704</dt>
705<dd>
706<p>
Junio C Hamano103b5722011-01-31 05:03:45707 Don&#8217;t match the pattern in binary files.
Junio C Hamano9882a522007-04-27 08:22:22708</p>
709</dd>
Junio C Hamano103b5722011-01-31 05:03:45710<dt class="hdlist1">
Junio C Hamano9f883862009-08-11 06:23:52711--max-depth &lt;depth&gt;
712</dt>
713<dd>
714<p>
Junio C Hamano74a198f2010-02-22 00:13:31715 For each &lt;pathspec&gt; given on command line, descend at most &lt;depth&gt;
Junio C Hamano9f883862009-08-11 06:23:52716 levels of directories. A negative value means no limit.
Junio C Hamanobfeab4e2012-01-19 00:51:27717 This option is ignored if &lt;pathspec&gt; contains active wildcards.
718 In other words if "a*" matches a directory named "a*",
719 "*" is matched literally so --max-depth is still effective.
Junio C Hamano9f883862009-08-11 06:23:52720</p>
721</dd>
Junio C Hamano103b5722011-01-31 05:03:45722<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47723-w
724</dt>
Junio C Hamano103b5722011-01-31 05:03:45725<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47726--word-regexp
Junio C Hamano617fdb82006-05-16 02:14:21727</dt>
728<dd>
729<p>
730 Match the pattern only at word boundary (either begin at the
731 beginning of a line, or preceded by a non-word character; end at
732 the end of a line or followed by a non-word character).
733</p>
734</dd>
Junio C Hamano103b5722011-01-31 05:03:45735<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47736-v
737</dt>
Junio C Hamano103b5722011-01-31 05:03:45738<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47739--invert-match
Junio C Hamano617fdb82006-05-16 02:14:21740</dt>
741<dd>
742<p>
743 Select non-matching lines.
744</p>
745</dd>
Junio C Hamano103b5722011-01-31 05:03:45746<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47747-h
748</dt>
Junio C Hamano103b5722011-01-31 05:03:45749<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47750-H
Junio C Hamano97efb002006-09-16 18:16:04751</dt>
752<dd>
753<p>
754 By default, the command shows the filename for each
755 match. <tt>-h</tt> option is used to suppress this output.
756 <tt>-H</tt> is there for completeness and does not do anything
757 except it overrides <tt>-h</tt> given earlier on the command
758 line.
759</p>
760</dd>
Junio C Hamano103b5722011-01-31 05:03:45761<dt class="hdlist1">
Junio C Hamano85e45fa2006-08-13 07:47:41762--full-name
763</dt>
764<dd>
765<p>
766 When run from a subdirectory, the command usually
767 outputs paths relative to the current directory. This
768 option forces paths to be output relative to the project
769 top directory.
770</p>
771</dd>
Junio C Hamano103b5722011-01-31 05:03:45772<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47773-E
774</dt>
Junio C Hamano103b5722011-01-31 05:03:45775<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47776--extended-regexp
777</dt>
Junio C Hamano103b5722011-01-31 05:03:45778<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47779-G
780</dt>
Junio C Hamano103b5722011-01-31 05:03:45781<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47782--basic-regexp
Junio C Hamano617fdb82006-05-16 02:14:21783</dt>
784<dd>
785<p>
786 Use POSIX extended/basic regexp for patterns. Default
787 is to use basic regexp.
788</p>
789</dd>
Junio C Hamano103b5722011-01-31 05:03:45790<dt class="hdlist1">
Junio C Hamano084228c2011-05-30 08:13:52791-P
792</dt>
793<dt class="hdlist1">
794--perl-regexp
795</dt>
796<dd>
797<p>
798 Use Perl-compatible regexp for patterns. Requires libpcre to be
799 compiled in.
800</p>
801</dd>
802<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47803-F
804</dt>
Junio C Hamano103b5722011-01-31 05:03:45805<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47806--fixed-strings
Junio C Hamano9882a522007-04-27 08:22:22807</dt>
808<dd>
809<p>
Junio C Hamano103b5722011-01-31 05:03:45810 Use fixed strings for patterns (don&#8217;t interpret pattern
Junio C Hamano9882a522007-04-27 08:22:22811 as a regex).
812</p>
813</dd>
Junio C Hamano103b5722011-01-31 05:03:45814<dt class="hdlist1">
Junio C Hamano617fdb82006-05-16 02:14:21815-n
816</dt>
Junio C Hamano2906d342011-03-29 02:19:17817<dt class="hdlist1">
818--line-number
819</dt>
Junio C Hamano617fdb82006-05-16 02:14:21820<dd>
821<p>
822 Prefix the line number to matching lines.
823</p>
824</dd>
Junio C Hamano103b5722011-01-31 05:03:45825<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47826-l
827</dt>
Junio C Hamano103b5722011-01-31 05:03:45828<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47829--files-with-matches
830</dt>
Junio C Hamano103b5722011-01-31 05:03:45831<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47832--name-only
833</dt>
Junio C Hamano103b5722011-01-31 05:03:45834<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47835-L
836</dt>
Junio C Hamano103b5722011-01-31 05:03:45837<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47838--files-without-match
Junio C Hamano617fdb82006-05-16 02:14:21839</dt>
840<dd>
841<p>
842 Instead of showing every matched line, show only the
843 names of files that contain (or do not contain) matches.
Junio C Hamano636c8b22010-03-07 22:25:17844 For better compatibility with <em>git diff</em>, <tt>--name-only</tt> is a
845 synonym for <tt>--files-with-matches</tt>.
Junio C Hamano617fdb82006-05-16 02:14:21846</p>
847</dd>
Junio C Hamano103b5722011-01-31 05:03:45848<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:51849-O [&lt;pager&gt;]
850</dt>
Junio C Hamano103b5722011-01-31 05:03:45851<dt class="hdlist1">
Junio C Hamano7d449522010-07-01 00:08:51852--open-files-in-pager [&lt;pager&gt;]
853</dt>
854<dd>
855<p>
856 Open the matching files in the pager (not the output of <em>grep</em>).
857 If the pager happens to be "less" or "vi", and the user
858 specified only one pattern, the first file is positioned at
859 the first match automatically.
860</p>
861</dd>
Junio C Hamano103b5722011-01-31 05:03:45862<dt class="hdlist1">
Junio C Hamanoa476efa2008-10-10 15:31:42863-z
864</dt>
Junio C Hamano103b5722011-01-31 05:03:45865<dt class="hdlist1">
Junio C Hamanoa476efa2008-10-10 15:31:42866--null
867</dt>
868<dd>
869<p>
870 Output \0 instead of the character that normally follows a
871 file name.
872</p>
873</dd>
Junio C Hamano103b5722011-01-31 05:03:45874<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47875-c
876</dt>
Junio C Hamano103b5722011-01-31 05:03:45877<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47878--count
Junio C Hamano617fdb82006-05-16 02:14:21879</dt>
880<dd>
881<p>
882 Instead of showing every matched line, show the number of
883 lines that match.
884</p>
885</dd>
Junio C Hamano103b5722011-01-31 05:03:45886<dt class="hdlist1">
Junio C Hamano4aa0bcc2010-03-03 05:13:12887--color[=&lt;when&gt;]
Junio C Hamanod257cff2009-03-18 05:27:16888</dt>
889<dd>
890<p>
891 Show colored matches.
Junio C Hamano4aa0bcc2010-03-03 05:13:12892 The value must be always (the default), never, or auto.
Junio C Hamanod257cff2009-03-18 05:27:16893</p>
894</dd>
Junio C Hamano103b5722011-01-31 05:03:45895<dt class="hdlist1">
Junio C Hamanod257cff2009-03-18 05:27:16896--no-color
897</dt>
898<dd>
899<p>
900 Turn off match highlighting, even when the configuration file
901 gives the default to color output.
Junio C Hamano4aa0bcc2010-03-03 05:13:12902 Same as <tt>--color=never</tt>.
Junio C Hamanod257cff2009-03-18 05:27:16903</p>
904</dd>
Junio C Hamano103b5722011-01-31 05:03:45905<dt class="hdlist1">
Junio C Hamano4c4b0122011-06-30 01:19:32906--break
907</dt>
908<dd>
909<p>
910 Print an empty line between matches from different files.
911</p>
912</dd>
913<dt class="hdlist1">
914--heading
915</dt>
916<dd>
917<p>
918 Show the filename above the matches in that file instead of
919 at the start of each shown line.
920</p>
921</dd>
922<dt class="hdlist1">
Junio C Hamano48bc1ce2009-07-09 16:49:19923-p
924</dt>
Junio C Hamano103b5722011-01-31 05:03:45925<dt class="hdlist1">
Junio C Hamano48bc1ce2009-07-09 16:49:19926--show-function
927</dt>
928<dd>
929<p>
930 Show the preceding line that contains the function name of
931 the match, unless the matching line is a function name itself.
932 The name is determined in the same way as <em>git diff</em> works out
933 patch hunk headers (see <em>Defining a custom hunk-header</em> in
934 <a href="gitattributes.html">gitattributes(5)</a>).
935</p>
936</dd>
Junio C Hamano103b5722011-01-31 05:03:45937<dt class="hdlist1">
Junio C Hamano9775d402011-08-11 22:27:20938-&lt;num&gt;
939</dt>
940<dt class="hdlist1">
941-C &lt;num&gt;
942</dt>
943<dt class="hdlist1">
944--context &lt;num&gt;
945</dt>
946<dd>
947<p>
948 Show &lt;num&gt; leading and trailing lines, and place a line
949 containing <tt>--</tt> between contiguous groups of matches.
950</p>
951</dd>
952<dt class="hdlist1">
953-A &lt;num&gt;
954</dt>
955<dt class="hdlist1">
956--after-context &lt;num&gt;
957</dt>
958<dd>
959<p>
960 Show &lt;num&gt; trailing lines, and place a line containing
961 <tt>--</tt> between contiguous groups of matches.
962</p>
963</dd>
964<dt class="hdlist1">
965-B &lt;num&gt;
966</dt>
967<dt class="hdlist1">
968--before-context &lt;num&gt;
969</dt>
970<dd>
971<p>
972 Show &lt;num&gt; leading lines, and place a line containing
973 <tt>--</tt> between contiguous groups of matches.
974</p>
975</dd>
976<dt class="hdlist1">
977-W
978</dt>
979<dt class="hdlist1">
980--function-context
981</dt>
982<dd>
983<p>
984 Show the surrounding text from the previous line containing a
985 function name up to the one before the next function name,
986 effectively showing the whole function in which the match was
987 found.
988</p>
989</dd>
990<dt class="hdlist1">
Junio C Hamano617fdb82006-05-16 02:14:21991-f &lt;file&gt;
992</dt>
993<dd>
994<p>
995 Read patterns from &lt;file&gt;, one per line.
996</p>
997</dd>
Junio C Hamano103b5722011-01-31 05:03:45998<dt class="hdlist1">
Junio C Hamano3901ffb2006-06-26 23:46:53999-e
1000</dt>
1001<dd>
1002<p>
1003 The next parameter is the pattern. This option has to be
Junio C Hamano636c8b22010-03-07 22:25:171004 used for patterns starting with <tt>-</tt> and should be used in
Junio C Hamano00442022006-08-03 00:29:361005 scripts passing user input to grep. Multiple patterns are
1006 combined by <em>or</em>.
1007</p>
1008</dd>
Junio C Hamano103b5722011-01-31 05:03:451009<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471010--and
1011</dt>
Junio C Hamano103b5722011-01-31 05:03:451012<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471013--or
1014</dt>
Junio C Hamano103b5722011-01-31 05:03:451015<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471016--not
1017</dt>
Junio C Hamano103b5722011-01-31 05:03:451018<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471019( &#8230; )
Junio C Hamano00442022006-08-03 00:29:361020</dt>
1021<dd>
1022<p>
Junio C Hamanof9771f62007-01-17 17:42:301023 Specify how multiple patterns are combined using Boolean
Junio C Hamano00442022006-08-03 00:29:361024 expressions. <tt>--or</tt> is the default operator. <tt>--and</tt> has
1025 higher precedence than <tt>--or</tt>. <tt>-e</tt> has to be used for all
1026 patterns.
Junio C Hamano3901ffb2006-06-26 23:46:531027</p>
1028</dd>
Junio C Hamano103b5722011-01-31 05:03:451029<dt class="hdlist1">
Junio C Hamanofbe00522006-10-19 05:58:481030--all-match
1031</dt>
1032<dd>
1033<p>
1034 When giving multiple pattern expressions combined with <tt>--or</tt>,
1035 this flag is specified to limit the match to files that
1036 have lines to match all of them.
1037</p>
1038</dd>
Junio C Hamano103b5722011-01-31 05:03:451039<dt class="hdlist1">
Junio C Hamano83b35472010-01-29 05:02:131040-q
1041</dt>
Junio C Hamano103b5722011-01-31 05:03:451042<dt class="hdlist1">
Junio C Hamano83b35472010-01-29 05:02:131043--quiet
1044</dt>
1045<dd>
1046<p>
1047 Do not output matched lines; instead, exit with status 0 when
Junio C Hamano103b5722011-01-31 05:03:451048 there is a match and with non-zero status when there isn&#8217;t.
Junio C Hamano83b35472010-01-29 05:02:131049</p>
1050</dd>
Junio C Hamano103b5722011-01-31 05:03:451051<dt class="hdlist1">
Junio C Hamano636c8b22010-03-07 22:25:171052&lt;tree&gt;&#8230;
Junio C Hamano617fdb82006-05-16 02:14:211053</dt>
1054<dd>
1055<p>
Junio C Hamano636c8b22010-03-07 22:25:171056 Instead of searching tracked files in the working tree, search
1057 blobs in the given trees.
Junio C Hamano617fdb82006-05-16 02:14:211058</p>
1059</dd>
Junio C Hamano103b5722011-01-31 05:03:451060<dt class="hdlist1">
Junio C Hamano00442022006-08-03 00:29:361061--
Junio C Hamanoa6331a82006-01-22 07:50:331062</dt>
1063<dd>
1064<p>
1065 Signals the end of options; the rest of the parameters
Junio C Hamano74a198f2010-02-22 00:13:311066 are &lt;pathspec&gt; limiters.
1067</p>
1068</dd>
Junio C Hamano103b5722011-01-31 05:03:451069<dt class="hdlist1">
Junio C Hamano74a198f2010-02-22 00:13:311070&lt;pathspec&gt;&#8230;
1071</dt>
1072<dd>
1073<p>
1074 If given, limit the search to paths matching at least one pattern.
1075 Both leading paths match and glob(7) patterns are supported.
Junio C Hamanoa6331a82006-01-22 07:50:331076</p>
1077</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311078</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231079</div>
Junio C Hamano636c8b22010-03-07 22:25:171080<h2 id="_examples">Examples</h2>
Junio C Hamano00442022006-08-03 00:29:361081<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:451082<div class="dlist"><dl>
1083<dt class="hdlist1">
Junio C Hamano16ebcd02011-08-05 00:05:451084<tt>git grep &#39;time_t&#39; -- &#39;*.[ch]&#39;</tt>
Junio C Hamano74a198f2010-02-22 00:13:311085</dt>
1086<dd>
1087<p>
1088 Looks for <tt>time_t</tt> in all tracked .c and .h files in the working
1089 directory and its subdirectories.
1090</p>
1091</dd>
Junio C Hamano103b5722011-01-31 05:03:451092<dt class="hdlist1">
Junio C Hamano16ebcd02011-08-05 00:05:451093<tt>git grep -e &#39;#define&#39; --and \( -e MAX_PATH -e PATH_MAX \)</tt>
Junio C Hamano00442022006-08-03 00:29:361094</dt>
1095<dd>
1096<p>
1097 Looks for a line that has <tt>#define</tt> and either <tt>MAX_PATH</tt> or
1098 <tt>PATH_MAX</tt>.
1099</p>
1100</dd>
Junio C Hamano103b5722011-01-31 05:03:451101<dt class="hdlist1">
Junio C Hamano16ebcd02011-08-05 00:05:451102<tt>git grep --all-match -e NODE -e Unexpected</tt>
Junio C Hamanofbe00522006-10-19 05:58:481103</dt>
1104<dd>
1105<p>
1106 Looks for a line that has <tt>NODE</tt> or <tt>Unexpected</tt> in
1107 files that have lines that match both.
1108</p>
1109</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311110</dl></div>
Junio C Hamano00442022006-08-03 00:29:361111</div>
Junio C Hamanoba4b9282008-07-06 05:20:311112<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231113<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:451114<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231115</div>
Junio C Hamano7bd050f2011-09-22 06:32:221116</div>
1117<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:231118<div id="footer">
1119<div id="footer-text">
Junio C Hamanobfeab4e2012-01-19 00:51:271120Last updated 2012-01-18 16:51:00 PDT
Junio C Hamano1a4e8412005-12-27 08:17:231121</div>
1122</div>
1123</body>
1124</html>