Autogenerated HTML docs for v1.7.7-rc2-4-g5ec82
[git/jnareb-git.git] / git-grep.html
blob26f12d46db60332e520569a1706bea0b3b12864a
1 <!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" />
6 <meta name="generator" content="AsciiDoc 8.5.2" />
7 <title>git-grep(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, 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;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#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;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.0em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
131 div.content { /* Block element content. */
132 padding: 0;
135 /* Block element titles. */
136 div.title, caption.title {
137 color: #527bbd;
138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
144 div.title + * {
145 margin-top: 0;
148 td div.title:first-child {
149 margin-top: 0.0em;
151 div.content div.title:first-child {
152 margin-top: 0.0em;
154 div.content + div.title {
155 margin-top: 0.0em;
158 div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
164 div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
170 div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
173 margin-right: 10%;
174 border-left: 5px solid #dddddd;
175 color: #777777;
178 div.quoteblock > div.attribution {
179 padding-top: 0.5em;
180 text-align: right;
183 div.verseblock > div.content {
184 white-space: pre;
186 div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div.verseblock + div.attribution {
192 text-align: left;
195 div.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;
203 div.admonitionblock td.content {
204 padding-left: 0.5em;
205 border-left: 3px solid #dddddd;
208 div.exampleblock > div.content {
209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
213 div.imageblock div.content { padding-left: 0; }
214 span.image img { border-style: none; }
215 a.image:visited { color: white; }
217 dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
221 dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
224 font-style: normal;
225 color: navy;
227 dd > *:first-child {
228 margin-top: 0.1em;
231 ul, ol {
232 list-style-position: outside;
234 ol.arabic {
235 list-style-type: decimal;
237 ol.loweralpha {
238 list-style-type: lower-alpha;
240 ol.upperalpha {
241 list-style-type: upper-alpha;
243 ol.lowerroman {
244 list-style-type: lower-roman;
246 ol.upperroman {
247 list-style-type: upper-roman;
250 div.compact ul, div.compact ol,
251 div.compact p, div.compact p,
252 div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
257 div.tableblock > table {
258 border: 3px solid #527bbd;
260 thead, p.table.header {
261 font-family: sans-serif;
262 font-weight: bold;
264 tfoot {
265 font-weight: bold;
267 td > div.verse {
268 white-space: pre;
270 p.table {
271 margin-top: 0;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div.tableblock > table[frame="void"] {
275 border-style: none;
277 div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
281 div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
287 div.hdlist {
288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
291 div.hdlist tr {
292 padding-bottom: 15px;
294 dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
297 td.hdlist1 {
298 vertical-align: top;
299 font-style: normal;
300 padding-right: 0.8em;
301 color: navy;
303 td.hdlist2 {
304 vertical-align: top;
306 div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
311 .comment {
312 background: yellow;
315 .footnote, .footnoteref {
316 font-size: 0.8em;
319 span.footnote, span.footnoteref {
320 vertical-align: super;
323 #footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
328 #footnotes div.footnote {
329 margin: 0 0 5px 0;
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;
343 @media print {
344 div#footer-badges { display: none; }
347 div#toc {
348 margin-bottom: 2.5em;
351 div#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;
360 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
364 div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
368 div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
372 div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
376 /* Overrides for manpage documents */
377 h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
383 h2 {
384 border-style: none;
386 div.sectionbody {
387 margin-left: 5%;
390 @media print {
391 div#toc { display: none; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
401 div.sidebar-title, div.image-title {
402 color: #527bbd;
403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
409 div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
415 div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
420 div.verseblock-content {
421 white-space: pre;
423 div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
428 div.exampleblock-content {
429 border-left: 3px solid #dddddd;
430 padding-left: 0.5em;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc a:visited { color: blue; }
435 </style>
436 <script type="text/javascript">
437 /*<![CDATA[*/
438 window.onload = function(){asciidoc.footnotes();}
439 var asciidoc = { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
449 * Version: 0.4
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.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
458 // toclevels = 1..4.
459 toc: function (toclevels) {
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);
469 return text;
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
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);
491 iterate(i);
495 iterate(el);
496 return result;
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);
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: 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;
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>]";
567 /*]]>*/
568 </script>
569 </head>
570 <body>
571 <div id="header">
572 <h1>
573 git-grep(1) Manual Page
574 </h1>
575 <h2>NAME</h2>
576 <div class="sectionbody">
577 <p>git-grep -
578 Print lines matching a pattern
579 </p>
580 </div>
581 </div>
582 <div id="content">
583 <h2 id="_synopsis">SYNOPSIS</h2>
584 <div class="sectionbody">
585 <div class="verseblock">
586 <div class="verseblock-content"><em>git grep</em> [-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp]
587 [-v | --invert-match] [-h|-H] [--full-name]
588 [-E | --extended-regexp] [-G | --basic-regexp]
589 [-P | --perl-regexp]
590 [-F | --fixed-strings] [-n | --line-number]
591 [-l | --files-with-matches] [-L | --files-without-match]
592 [(-O | --open-files-in-pager) [&lt;pager&gt;]]
593 [-z | --null]
594 [-c | --count] [--all-match] [-q | --quiet]
595 [--max-depth &lt;depth&gt;]
596 [--color[=&lt;when&gt;] | --no-color]
597 [-A &lt;post-context&gt;] [-B &lt;pre-context&gt;] [-C &lt;context&gt;]
598 [-f &lt;file&gt;] [-e] &lt;pattern&gt;
599 [--and|--or|--not|(|)|-e &lt;pattern&gt;&#8230;]
600 [--cached | --no-index | &lt;tree&gt;&#8230;]
601 [--] [&lt;pathspec&gt;&#8230;]</div>
602 <div class="verseblock-attribution">
603 </div></div>
604 </div>
605 <h2 id="_description">DESCRIPTION</h2>
606 <div class="sectionbody">
607 <div class="paragraph"><p>Look for specified patterns in the tracked files in the work tree, blobs
608 registered in the index file, or blobs in given tree objects.</p></div>
609 </div>
610 <h2 id="_configuration">CONFIGURATION</h2>
611 <div class="sectionbody">
612 <div class="dlist"><dl>
613 <dt class="hdlist1">
614 grep.lineNumber
615 </dt>
616 <dd>
618 If set to true, enable <em>-n</em> option by default.
619 </p>
620 </dd>
621 <dt class="hdlist1">
622 grep.extendedRegexp
623 </dt>
624 <dd>
626 If set to true, enable <em>--extended-regexp</em> option by default.
627 </p>
628 </dd>
629 </dl></div>
630 </div>
631 <h2 id="_options">OPTIONS</h2>
632 <div class="sectionbody">
633 <div class="dlist"><dl>
634 <dt class="hdlist1">
635 --cached
636 </dt>
637 <dd>
639 Instead of searching tracked files in the working tree, search
640 blobs registered in the index file.
641 </p>
642 </dd>
643 <dt class="hdlist1">
644 --no-index
645 </dt>
646 <dd>
648 Search files in the current directory, not just those tracked by git.
649 </p>
650 </dd>
651 <dt class="hdlist1">
653 </dt>
654 <dt class="hdlist1">
655 --text
656 </dt>
657 <dd>
659 Process binary files as if they were text.
660 </p>
661 </dd>
662 <dt class="hdlist1">
664 </dt>
665 <dt class="hdlist1">
666 --ignore-case
667 </dt>
668 <dd>
670 Ignore case differences between the patterns and the
671 files.
672 </p>
673 </dd>
674 <dt class="hdlist1">
676 </dt>
677 <dd>
679 Don&#8217;t match the pattern in binary files.
680 </p>
681 </dd>
682 <dt class="hdlist1">
683 --max-depth &lt;depth&gt;
684 </dt>
685 <dd>
687 For each &lt;pathspec&gt; given on command line, descend at most &lt;depth&gt;
688 levels of directories. A negative value means no limit.
689 </p>
690 </dd>
691 <dt class="hdlist1">
693 </dt>
694 <dt class="hdlist1">
695 --word-regexp
696 </dt>
697 <dd>
699 Match the pattern only at word boundary (either begin at the
700 beginning of a line, or preceded by a non-word character; end at
701 the end of a line or followed by a non-word character).
702 </p>
703 </dd>
704 <dt class="hdlist1">
706 </dt>
707 <dt class="hdlist1">
708 --invert-match
709 </dt>
710 <dd>
712 Select non-matching lines.
713 </p>
714 </dd>
715 <dt class="hdlist1">
717 </dt>
718 <dt class="hdlist1">
720 </dt>
721 <dd>
723 By default, the command shows the filename for each
724 match. <tt>-h</tt> option is used to suppress this output.
725 <tt>-H</tt> is there for completeness and does not do anything
726 except it overrides <tt>-h</tt> given earlier on the command
727 line.
728 </p>
729 </dd>
730 <dt class="hdlist1">
731 --full-name
732 </dt>
733 <dd>
735 When run from a subdirectory, the command usually
736 outputs paths relative to the current directory. This
737 option forces paths to be output relative to the project
738 top directory.
739 </p>
740 </dd>
741 <dt class="hdlist1">
743 </dt>
744 <dt class="hdlist1">
745 --extended-regexp
746 </dt>
747 <dt class="hdlist1">
749 </dt>
750 <dt class="hdlist1">
751 --basic-regexp
752 </dt>
753 <dd>
755 Use POSIX extended/basic regexp for patterns. Default
756 is to use basic regexp.
757 </p>
758 </dd>
759 <dt class="hdlist1">
761 </dt>
762 <dt class="hdlist1">
763 --perl-regexp
764 </dt>
765 <dd>
767 Use Perl-compatible regexp for patterns. Requires libpcre to be
768 compiled in.
769 </p>
770 </dd>
771 <dt class="hdlist1">
773 </dt>
774 <dt class="hdlist1">
775 --fixed-strings
776 </dt>
777 <dd>
779 Use fixed strings for patterns (don&#8217;t interpret pattern
780 as a regex).
781 </p>
782 </dd>
783 <dt class="hdlist1">
785 </dt>
786 <dt class="hdlist1">
787 --line-number
788 </dt>
789 <dd>
791 Prefix the line number to matching lines.
792 </p>
793 </dd>
794 <dt class="hdlist1">
796 </dt>
797 <dt class="hdlist1">
798 --files-with-matches
799 </dt>
800 <dt class="hdlist1">
801 --name-only
802 </dt>
803 <dt class="hdlist1">
805 </dt>
806 <dt class="hdlist1">
807 --files-without-match
808 </dt>
809 <dd>
811 Instead of showing every matched line, show only the
812 names of files that contain (or do not contain) matches.
813 For better compatibility with <em>git diff</em>, <tt>--name-only</tt> is a
814 synonym for <tt>--files-with-matches</tt>.
815 </p>
816 </dd>
817 <dt class="hdlist1">
818 -O [&lt;pager&gt;]
819 </dt>
820 <dt class="hdlist1">
821 --open-files-in-pager [&lt;pager&gt;]
822 </dt>
823 <dd>
825 Open the matching files in the pager (not the output of <em>grep</em>).
826 If the pager happens to be "less" or "vi", and the user
827 specified only one pattern, the first file is positioned at
828 the first match automatically.
829 </p>
830 </dd>
831 <dt class="hdlist1">
833 </dt>
834 <dt class="hdlist1">
835 --null
836 </dt>
837 <dd>
839 Output \0 instead of the character that normally follows a
840 file name.
841 </p>
842 </dd>
843 <dt class="hdlist1">
845 </dt>
846 <dt class="hdlist1">
847 --count
848 </dt>
849 <dd>
851 Instead of showing every matched line, show the number of
852 lines that match.
853 </p>
854 </dd>
855 <dt class="hdlist1">
856 --color[=&lt;when&gt;]
857 </dt>
858 <dd>
860 Show colored matches.
861 The value must be always (the default), never, or auto.
862 </p>
863 </dd>
864 <dt class="hdlist1">
865 --no-color
866 </dt>
867 <dd>
869 Turn off match highlighting, even when the configuration file
870 gives the default to color output.
871 Same as <tt>--color=never</tt>.
872 </p>
873 </dd>
874 <dt class="hdlist1">
875 --break
876 </dt>
877 <dd>
879 Print an empty line between matches from different files.
880 </p>
881 </dd>
882 <dt class="hdlist1">
883 --heading
884 </dt>
885 <dd>
887 Show the filename above the matches in that file instead of
888 at the start of each shown line.
889 </p>
890 </dd>
891 <dt class="hdlist1">
893 </dt>
894 <dt class="hdlist1">
895 --show-function
896 </dt>
897 <dd>
899 Show the preceding line that contains the function name of
900 the match, unless the matching line is a function name itself.
901 The name is determined in the same way as <em>git diff</em> works out
902 patch hunk headers (see <em>Defining a custom hunk-header</em> in
903 <a href="gitattributes.html">gitattributes(5)</a>).
904 </p>
905 </dd>
906 <dt class="hdlist1">
907 -&lt;num&gt;
908 </dt>
909 <dt class="hdlist1">
910 -C &lt;num&gt;
911 </dt>
912 <dt class="hdlist1">
913 --context &lt;num&gt;
914 </dt>
915 <dd>
917 Show &lt;num&gt; leading and trailing lines, and place a line
918 containing <tt>--</tt> between contiguous groups of matches.
919 </p>
920 </dd>
921 <dt class="hdlist1">
922 -A &lt;num&gt;
923 </dt>
924 <dt class="hdlist1">
925 --after-context &lt;num&gt;
926 </dt>
927 <dd>
929 Show &lt;num&gt; trailing lines, and place a line containing
930 <tt>--</tt> between contiguous groups of matches.
931 </p>
932 </dd>
933 <dt class="hdlist1">
934 -B &lt;num&gt;
935 </dt>
936 <dt class="hdlist1">
937 --before-context &lt;num&gt;
938 </dt>
939 <dd>
941 Show &lt;num&gt; leading lines, and place a line containing
942 <tt>--</tt> between contiguous groups of matches.
943 </p>
944 </dd>
945 <dt class="hdlist1">
947 </dt>
948 <dt class="hdlist1">
949 --function-context
950 </dt>
951 <dd>
953 Show the surrounding text from the previous line containing a
954 function name up to the one before the next function name,
955 effectively showing the whole function in which the match was
956 found.
957 </p>
958 </dd>
959 <dt class="hdlist1">
960 -f &lt;file&gt;
961 </dt>
962 <dd>
964 Read patterns from &lt;file&gt;, one per line.
965 </p>
966 </dd>
967 <dt class="hdlist1">
969 </dt>
970 <dd>
972 The next parameter is the pattern. This option has to be
973 used for patterns starting with <tt>-</tt> and should be used in
974 scripts passing user input to grep. Multiple patterns are
975 combined by <em>or</em>.
976 </p>
977 </dd>
978 <dt class="hdlist1">
979 --and
980 </dt>
981 <dt class="hdlist1">
982 --or
983 </dt>
984 <dt class="hdlist1">
985 --not
986 </dt>
987 <dt class="hdlist1">
988 ( &#8230; )
989 </dt>
990 <dd>
992 Specify how multiple patterns are combined using Boolean
993 expressions. <tt>--or</tt> is the default operator. <tt>--and</tt> has
994 higher precedence than <tt>--or</tt>. <tt>-e</tt> has to be used for all
995 patterns.
996 </p>
997 </dd>
998 <dt class="hdlist1">
999 --all-match
1000 </dt>
1001 <dd>
1003 When giving multiple pattern expressions combined with <tt>--or</tt>,
1004 this flag is specified to limit the match to files that
1005 have lines to match all of them.
1006 </p>
1007 </dd>
1008 <dt class="hdlist1">
1010 </dt>
1011 <dt class="hdlist1">
1012 --quiet
1013 </dt>
1014 <dd>
1016 Do not output matched lines; instead, exit with status 0 when
1017 there is a match and with non-zero status when there isn&#8217;t.
1018 </p>
1019 </dd>
1020 <dt class="hdlist1">
1021 &lt;tree&gt;&#8230;
1022 </dt>
1023 <dd>
1025 Instead of searching tracked files in the working tree, search
1026 blobs in the given trees.
1027 </p>
1028 </dd>
1029 <dt class="hdlist1">
1031 </dt>
1032 <dd>
1034 Signals the end of options; the rest of the parameters
1035 are &lt;pathspec&gt; limiters.
1036 </p>
1037 </dd>
1038 <dt class="hdlist1">
1039 &lt;pathspec&gt;&#8230;
1040 </dt>
1041 <dd>
1043 If given, limit the search to paths matching at least one pattern.
1044 Both leading paths match and glob(7) patterns are supported.
1045 </p>
1046 </dd>
1047 </dl></div>
1048 </div>
1049 <h2 id="_examples">Examples</h2>
1050 <div class="sectionbody">
1051 <div class="dlist"><dl>
1052 <dt class="hdlist1">
1053 <tt>git grep &#39;time_t&#39; -- &#39;*.[ch]&#39;</tt>
1054 </dt>
1055 <dd>
1057 Looks for <tt>time_t</tt> in all tracked .c and .h files in the working
1058 directory and its subdirectories.
1059 </p>
1060 </dd>
1061 <dt class="hdlist1">
1062 <tt>git grep -e &#39;#define&#39; --and \( -e MAX_PATH -e PATH_MAX \)</tt>
1063 </dt>
1064 <dd>
1066 Looks for a line that has <tt>#define</tt> and either <tt>MAX_PATH</tt> or
1067 <tt>PATH_MAX</tt>.
1068 </p>
1069 </dd>
1070 <dt class="hdlist1">
1071 <tt>git grep --all-match -e NODE -e Unexpected</tt>
1072 </dt>
1073 <dd>
1075 Looks for a line that has <tt>NODE</tt> or <tt>Unexpected</tt> in
1076 files that have lines that match both.
1077 </p>
1078 </dd>
1079 </dl></div>
1080 </div>
1081 <h2 id="_git">GIT</h2>
1082 <div class="sectionbody">
1083 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1084 </div>
1085 </div>
1086 <div id="footnotes"><hr /></div>
1087 <div id="footer">
1088 <div id="footer-text">
1089 Last updated 2011-09-21 23:01:14 PDT
1090 </div>
1091 </div>
1092 </body>
1093 </html>