Autogenerated HTML docs for v1.2.0-g6a9b
[git.git] / git-ls-files.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
2     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
4 <head>\r
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
6 <meta name="generator" content="AsciiDoc 7.0.2" />\r
7 <style type="text/css">\r
8 /* Debug borders */\r
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {\r
10 /*\r
11   border: 1px solid red;\r
12 */\r
13 }\r
14 \r
15 body {\r
16   margin: 1em 5% 1em 5%;\r
17 }\r
18 \r
19 a { color: blue; }\r
20 a:visited { color: fuchsia; }\r
21 \r
22 em {\r
23   font-style: italic;\r
24 }\r
25 \r
26 strong {\r
27   font-weight: bold;\r
28 }\r
29 \r
30 tt {\r
31   color: navy;\r
32 }\r
33 \r
34 h1, h2, h3, h4, h5, h6 {\r
35   color: #527bbd;\r
36   font-family: sans-serif;\r
37   margin-top: 1.2em;\r
38   margin-bottom: 0.5em;\r
39   line-height: 1.3;\r
40 }\r
41 \r
42 h1 {\r
43   border-bottom: 2px solid silver;\r
44 }\r
45 h2 {\r
46   border-bottom: 2px solid silver;\r
47   padding-top: 0.5em;\r
48 }\r
49 \r
50 div.sectionbody {\r
51   font-family: serif;\r
52   margin-left: 0;\r
53 }\r
54 \r
55 hr {\r
56   border: 1px solid silver;\r
57 }\r
58 \r
59 p {\r
60   margin-top: 0.5em;\r
61   margin-bottom: 0.5em;\r
62 }\r
63 \r
64 pre {\r
65   padding: 0;\r
66   margin: 0;\r
67 }\r
68 \r
69 span#author {\r
70   color: #527bbd;\r
71   font-family: sans-serif;\r
72   font-weight: bold;\r
73   font-size: 1.2em;\r
74 }\r
75 span#email {\r
76 }\r
77 span#revision {\r
78   font-family: sans-serif;\r
79 }\r
80 \r
81 div#footer {\r
82   font-family: sans-serif;\r
83   font-size: small;\r
84   border-top: 2px solid silver;\r
85   padding-top: 0.5em;\r
86   margin-top: 4.0em;\r
87 }\r
88 div#footer-text {\r
89   float: left;\r
90   padding-bottom: 0.5em;\r
91 }\r
92 div#footer-badges {\r
93   float: right;\r
94   padding-bottom: 0.5em;\r
95 }\r
96 \r
97 div#preamble,\r
98 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,\r
99 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
100 div.admonitionblock {\r
101   margin-right: 10%;\r
102   margin-top: 1.5em;\r
103   margin-bottom: 1.5em;\r
104 }\r
105 div.admonitionblock {\r
106   margin-top: 2.5em;\r
107   margin-bottom: 2.5em;\r
108 }\r
109 \r
110 div.content { /* Block element content. */\r
111   padding: 0;\r
112 }\r
113 \r
114 /* Block element titles. */\r
115 div.title, caption.title {\r
116   font-family: sans-serif;\r
117   font-weight: bold;\r
118   text-align: left;\r
119   margin-top: 1.0em;\r
120   margin-bottom: 0.5em;\r
121 }\r
122 div.title + * {\r
123   margin-top: 0;\r
124 }\r
125 \r
126 td div.title:first-child {\r
127   margin-top: 0.0em;\r
128 }\r
129 div.content div.title:first-child {\r
130   margin-top: 0.0em;\r
131 }\r
132 div.content + div.title {\r
133   margin-top: 0.0em;\r
134 }\r
135 \r
136 div.sidebarblock > div.content {\r
137   background: #ffffee;\r
138   border: 1px solid silver;\r
139   padding: 0.5em;\r
140 }\r
141 \r
142 div.listingblock > div.content {\r
143   border: 1px solid silver;\r
144   background: #f4f4f4;\r
145   padding: 0.5em;\r
146 }\r
147 \r
148 div.quoteblock > div.content {\r
149   padding-left: 2.0em;\r
150 }\r
151 div.quoteblock .attribution {\r
152   text-align: right;\r
153 }\r
154 \r
155 div.admonitionblock .icon {\r
156   vertical-align: top;\r
157   font-size: 1.1em;\r
158   font-weight: bold;\r
159   text-decoration: underline;\r
160   color: #527bbd;\r
161   padding-right: 0.5em;\r
162 }\r
163 div.admonitionblock td.content {\r
164   padding-left: 0.5em;\r
165   border-left: 2px solid silver;\r
166 }\r
167 \r
168 div.exampleblock > div.content {\r
169   border-left: 2px solid silver;\r
170   padding: 0.5em;\r
171 }\r
172 \r
173 div.verseblock div.content {\r
174   white-space: pre;\r
175 }\r
176 \r
177 div.imageblock div.content { padding-left: 0; }\r
178 div.imageblock img { border: 1px solid silver; }\r
179 span.image img { border-style: none; }\r
180 \r
181 dl {\r
182   margin-top: 0.8em;\r
183   margin-bottom: 0.8em;\r
184 }\r
185 dt {\r
186   margin-top: 0.5em;\r
187   margin-bottom: 0;\r
188   font-style: italic;\r
189 }\r
190 dd > *:first-child {\r
191   margin-top: 0;\r
192 }\r
193 \r
194 ul, ol {\r
195     list-style-position: outside;\r
196 }\r
197 ol.olist2 {\r
198   list-style-type: lower-alpha;\r
199 }\r
200 \r
201 div.tableblock > table {\r
202   border-color: #527bbd;\r
203   border-width: 3px;\r
204 }\r
205 thead {\r
206   font-family: sans-serif;\r
207   font-weight: bold;\r
208 }\r
209 tfoot {\r
210   font-weight: bold;\r
211 }\r
212 \r
213 div.hlist {\r
214   margin-top: 0.8em;\r
215   margin-bottom: 0.8em;\r
216 }\r
217 td.hlist1 {\r
218   vertical-align: top;\r
219   font-style: italic;\r
220   padding-right: 0.8em;\r
221 }\r
222 td.hlist2 {\r
223   vertical-align: top;\r
224 }\r
225 \r
226 @media print {\r
227   div#footer-badges { display: none; }\r
228 }\r
229 include::./stylesheets/xhtml11-manpage.css[]\r
230 /* Workarounds for IE6's broken and incomplete CSS2. */\r
231 \r
232 div.sidebar-content {\r
233   background: #ffffee;\r
234   border: 1px solid silver;\r
235   padding: 0.5em;\r
236 }\r
237 div.sidebar-title, div.image-title {\r
238   font-family: sans-serif;\r
239   font-weight: bold;\r
240   margin-top: 0.0em;\r
241   margin-bottom: 0.5em;\r
242 }\r
243 \r
244 div.listingblock div.content {\r
245   border: 1px solid silver;\r
246   background: #f4f4f4;\r
247   padding: 0.5em;\r
248 }\r
249 \r
250 div.quoteblock-content {\r
251   padding-left: 2.0em;\r
252 }\r
253 \r
254 div.exampleblock-content {\r
255   border-left: 2px solid silver;\r
256   padding-left: 0.5em;\r
257 }\r
258 </style>\r
259 <title>git-ls-files(1)</title>\r
260 </head>\r
261 <body>\r
262 <div id="header">\r
263 <h1>\r
264 git-ls-files(1) Manual Page\r
265 </h1>\r
266 <h2>NAME</h2>\r
267 <div class="sectionbody">\r
268 <p>git-ls-files -\r
269    Information about files in the index/working directory\r
270 </p>\r
271 </div>\r
272 </div>\r
273 <h2>SYNOPSIS</h2>\r
274 <div class="sectionbody">\r
275 <p><em>git-ls-files</em> [-z] [-t]\r
276                 (--[cached|deleted|others|ignored|stage|unmerged|killed|modified])*\r
277                 (-[c|d|o|i|s|u|k|m])*\r
278                 [-x &lt;pattern&gt;|--exclude=&lt;pattern&gt;]\r
279                 [-X &lt;file&gt;|--exclude-from=&lt;file&gt;]\r
280                 [--exclude-per-directory=&lt;file&gt;]\r
281                 [--full-name] [--] [&lt;file&gt;]*</p>\r
282 </div>\r
283 <h2>DESCRIPTION</h2>\r
284 <div class="sectionbody">\r
285 <p>This merges the file listing in the directory cache index with the\r
286 actual working directory list, and shows different combinations of the\r
287 two.</p>\r
288 <p>One or more of the options below may be used to determine the files\r
289 shown:</p>\r
290 </div>\r
291 <h2>OPTIONS</h2>\r
292 <div class="sectionbody">\r
293 <dl>\r
294 <dt>\r
295 -c|--cached\r
296 </dt>\r
297 <dd>\r
298 <p>\r
299         Show cached files in the output (default)\r
300 </p>\r
301 </dd>\r
302 <dt>\r
303 -d|--deleted\r
304 </dt>\r
305 <dd>\r
306 <p>\r
307         Show deleted files in the output\r
308 </p>\r
309 </dd>\r
310 <dt>\r
311 -m|--modified\r
312 </dt>\r
313 <dd>\r
314 <p>\r
315         Show modified files in the output\r
316 </p>\r
317 </dd>\r
318 <dt>\r
319 -o|--others\r
320 </dt>\r
321 <dd>\r
322 <p>\r
323         Show other files in the output\r
324 </p>\r
325 </dd>\r
326 <dt>\r
327 -i|--ignored\r
328 </dt>\r
329 <dd>\r
330 <p>\r
331         Show ignored files in the output\r
332         Note the this also reverses any exclude list present.\r
333 </p>\r
334 </dd>\r
335 <dt>\r
336 -s|--stage\r
337 </dt>\r
338 <dd>\r
339 <p>\r
340         Show stage files in the output\r
341 </p>\r
342 </dd>\r
343 <dt>\r
344 --directory\r
345 </dt>\r
346 <dd>\r
347 <p>\r
348         If a whole directory is classified as "other", show just its\r
349         name (with a trailing slash) and not its whole contents.\r
350 </p>\r
351 </dd>\r
352 <dt>\r
353 -u|--unmerged\r
354 </dt>\r
355 <dd>\r
356 <p>\r
357         Show unmerged files in the output (forces --stage)\r
358 </p>\r
359 </dd>\r
360 <dt>\r
361 -k|--killed\r
362 </dt>\r
363 <dd>\r
364 <p>\r
365         Show files on the filesystem that need to be removed due\r
366         to file/directory conflicts for checkout-index to\r
367         succeed.\r
368 </p>\r
369 </dd>\r
370 <dt>\r
371 -z\r
372 </dt>\r
373 <dd>\r
374 <p>\r
375         \0 line termination on output.\r
376 </p>\r
377 </dd>\r
378 <dt>\r
379 -x|--exclude=&lt;pattern&gt;\r
380 </dt>\r
381 <dd>\r
382 <p>\r
383         Skips files matching pattern.\r
384         Note that pattern is a shell wildcard pattern.\r
385 </p>\r
386 </dd>\r
387 <dt>\r
388 -X|--exclude-from=&lt;file&gt;\r
389 </dt>\r
390 <dd>\r
391 <p>\r
392         exclude patterns are read from &lt;file&gt;; 1 per line.\r
393 </p>\r
394 </dd>\r
395 <dt>\r
396 --exclude-per-directory=&lt;file&gt;\r
397 </dt>\r
398 <dd>\r
399 <p>\r
400         read additional exclude patterns that apply only to the\r
401         directory and its subdirectories in &lt;file&gt;.\r
402 </p>\r
403 </dd>\r
404 <dt>\r
405 -t\r
406 </dt>\r
407 <dd>\r
408 <p>\r
409         Identify the file status with the following tags (followed by\r
410         a space) at the start of each line:\r
411 </p>\r
412 <div class="hlist"><table>\r
413 <tr>\r
414 <td class="hlist1">\r
415 H\r
416 </td>\r
417 <td class="hlist2">\r
418 cached\r
419 </td>\r
420 </tr>\r
421 <tr>\r
422 <td class="hlist1">\r
423 M\r
424 </td>\r
425 <td class="hlist2">\r
426 unmerged\r
427 </td>\r
428 </tr>\r
429 <tr>\r
430 <td class="hlist1">\r
431 R\r
432 </td>\r
433 <td class="hlist2">\r
434 removed/deleted\r
435 </td>\r
436 </tr>\r
437 <tr>\r
438 <td class="hlist1">\r
439 C\r
440 </td>\r
441 <td class="hlist2">\r
442 modified/changed\r
443 </td>\r
444 </tr>\r
445 <tr>\r
446 <td class="hlist1">\r
447 K\r
448 </td>\r
449 <td class="hlist2">\r
450 to be killed\r
451 </td>\r
452 </tr>\r
453 <tr>\r
454 <td class="hlist1">\r
455 ?\r
456 </td>\r
457 <td class="hlist2">\r
458 other\r
459 </td>\r
460 </tr>\r
461 </table></div>\r
462 </dd>\r
463 <dt>\r
464 --full-name\r
465 </dt>\r
466 <dd>\r
467 <p>\r
468         When run from a subdirectory, the command usually\r
469         outputs paths relative to the current directory.  This\r
470         option forces paths to be output relative to the project\r
471         top directory.\r
472 </p>\r
473 </dd>\r
474 <dt>\r
475 &#8212;\r
476 </dt>\r
477 <dd>\r
478 <p>\r
479         Do not interpret any more arguments as options.\r
480 </p>\r
481 </dd>\r
482 <dt>\r
483 &lt;file&gt;\r
484 </dt>\r
485 <dd>\r
486 <p>\r
487         Files to show. If no files are given all files which match the other\r
488         specified criteria are shown.\r
489 </p>\r
490 </dd>\r
491 </dl>\r
492 </div>\r
493 <h2>Output</h2>\r
494 <div class="sectionbody">\r
495 <p>show files just outputs the filename unless <em>--stage</em> is specified in\r
496 which case it outputs:</p>\r
497 <div class="literalblock">\r
498 <div class="content">\r
499 <pre><tt>[&lt;tag&gt; ]&lt;mode&gt; &lt;object&gt; &lt;stage&gt; &lt;file&gt;</tt></pre>\r
500 </div></div>\r
501 <p>"git-ls-files --unmerged" and "git-ls-files --stage" can be used to examine\r
502 detailed information on unmerged paths.</p>\r
503 <p>For an unmerged path, instead of recording a single mode/SHA1 pair,\r
504 the dircache records up to three such pairs; one from tree O in stage\r
505 1, A in stage 2, and B in stage 3.  This information can be used by\r
506 the user (or the porcelain) to see what should eventually be recorded at the\r
507 path. (see git-read-tree for more information on state)</p>\r
508 <p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters\r
509 in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>,\r
510 respectively.</p>\r
511 </div>\r
512 <h2>Exclude Patterns</h2>\r
513 <div class="sectionbody">\r
514 <p><em>git-ls-files</em> can use a list of "exclude patterns" when\r
515 traversing the directory tree and finding files to show when the\r
516 flags --others or --ignored are specified.</p>\r
517 <p>These exclude patterns come from these places:</p>\r
518 <ol>\r
519 <li>\r
520 <p>\r
521 command line flag --exclude=&lt;pattern&gt; specifies a single\r
522      pattern.\r
523 </p>\r
524 </li>\r
525 <li>\r
526 <p>\r
527 command line flag --exclude-from=&lt;file&gt; specifies a list of\r
528      patterns stored in a file.\r
529 </p>\r
530 </li>\r
531 <li>\r
532 <p>\r
533 command line flag --exclude-per-directory=&lt;name&gt; specifies\r
534      a name of the file in each directory <em>git-ls-files</em>\r
535      examines, and if exists, its contents are used as an\r
536      additional list of patterns.\r
537 </p>\r
538 </li>\r
539 </ol>\r
540 <p>An exclude pattern file used by (2) and (3) contains one pattern\r
541 per line.  A line that starts with a <em>#</em> can be used as comment\r
542 for readability.</p>\r
543 <p>There are three lists of patterns that are in effect at a given\r
544 time.  They are built and ordered in the following way:</p>\r
545 <ul>\r
546 <li>\r
547 <p>\r
548 --exclude=&lt;pattern&gt; from the command line; patterns are\r
549    ordered in the same order as they appear on the command line.\r
550 </p>\r
551 </li>\r
552 <li>\r
553 <p>\r
554 lines read from --exclude-from=&lt;file&gt;; patterns are ordered\r
555    in the same order as they appear in the file.\r
556 </p>\r
557 </li>\r
558 <li>\r
559 <p>\r
560 When --exclude-per-directory=&lt;name&gt; is specified, upon\r
561    entering a directory that has such a file, its contents are\r
562    appended at the end of the current "list of patterns".  They\r
563    are popped off when leaving the directory.\r
564 </p>\r
565 </li>\r
566 </ul>\r
567 <p>Each pattern in the pattern list specifies "a match pattern" and\r
568 optionally the fate; either a file that matches the pattern is\r
569 considered excluded or included.  A filename is matched against\r
570 the patterns in the three lists; the --exclude-from list is\r
571 checked first, then the --exclude-per-directory list, and then\r
572 finally the --exclude list. The last match determines its fate.\r
573 If there is no match in the three lists, the fate is "included".</p>\r
574 <p>A pattern specified on the command line with --exclude or read\r
575 from the file specified with --exclude-from is relative to the\r
576 top of the directory tree.  A pattern read from a file specified\r
577 by --exclude-per-directory is relative to the directory that the\r
578 pattern file appears in.</p>\r
579 <p>An exclude pattern is of the following format:</p>\r
580 <ul>\r
581 <li>\r
582 <p>\r
583 an optional prefix <em>!</em> which means that the fate this pattern\r
584    specifies is "include", not the usual "exclude"; the\r
585    remainder of the pattern string is interpreted according to\r
586    the following rules.\r
587 </p>\r
588 </li>\r
589 <li>\r
590 <p>\r
591 if it does not contain a slash <em>/</em>, it is a shell glob\r
592    pattern and used to match against the filename without\r
593    leading directories (i.e. the same way as the current\r
594    implementation).\r
595 </p>\r
596 </li>\r
597 <li>\r
598 <p>\r
599 otherwise, it is a shell glob pattern, suitable for\r
600    consumption by fnmatch(3) with FNM_PATHNAME flag.  I.e. a\r
601    slash in the pattern must match a slash in the pathname.\r
602    "Documentation/*.html" matches "Documentation/git.html" but\r
603    not "ppc/ppc.html".  As a natural exception, "/*.c" matches\r
604    "cat-file.c" but not "mozilla-sha1/sha1.c".\r
605 </p>\r
606 </li>\r
607 </ul>\r
608 <p>An example:</p>\r
609 <div class="listingblock">\r
610 <div class="content">\r
611 <pre><tt>    $ cat .git/ignore\r
612     # ignore objects and archives, anywhere in the tree.\r
613     *.[oa]\r
614     $ cat Documentation/.gitignore\r
615     # ignore generated html files,\r
616     *.html\r
617     # except foo.html which is maintained by hand\r
618     !foo.html\r
619     $ git-ls-files --ignored \\r
620         --exclude='Documentation/*.[0-9]' \\r
621         --exclude-from=.git/ignore \\r
622         --exclude-per-directory=.gitignore</tt></pre>\r
623 </div></div>\r
624 </div>\r
625 <h2>See Also</h2>\r
626 <div class="sectionbody">\r
627 <p><a href="git-read-tree.html">git-read-tree(1)</a></p>\r
628 </div>\r
629 <h2>Author</h2>\r
630 <div class="sectionbody">\r
631 <p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p>\r
632 </div>\r
633 <h2>Documentation</h2>\r
634 <div class="sectionbody">\r
635 <p>Documentation by David Greaves, Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p>\r
636 </div>\r
637 <h2>GIT</h2>\r
638 <div class="sectionbody">\r
639 <p>Part of the <a href="git.html">git(7)</a> suite</p>\r
640 </div>\r
641 <div id="footer">\r
642 <div id="footer-text">\r
643 Last updated 14-Feb-2006 07:59:59 UTC\r
644 </div>\r
645 </div>\r
646 </body>\r
647 </html>\r