Autogenerated HTML docs for v1.7.5-52-ge839f
[git/jnareb-git.git] / git-ls-files.html
blob9ce73e84570a4e6c48528adb993ffe2c33a42239
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.4.5" />
7 <title>git-ls-files(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.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-ls-files(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-ls-files -
411 Show information about files in the index and the working tree
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="verseblock">
418 <div class="verseblock-content"><em>git ls-files</em> [-z] [-t] [-v]
419 (--[cached|deleted|others|ignored|stage|unmerged|killed|modified])*
420 (-[c|d|o|i|s|u|k|m])*
421 [-x &lt;pattern&gt;|--exclude=&lt;pattern&gt;]
422 [-X &lt;file&gt;|--exclude-from=&lt;file&gt;]
423 [--exclude-per-directory=&lt;file&gt;]
424 [--exclude-standard]
425 [--error-unmatch] [--with-tree=&lt;tree-ish&gt;]
426 [--full-name] [--abbrev] [--] [&lt;file&gt;&#8230;]</div>
427 <div class="verseblock-attribution">
428 </div></div>
429 </div>
430 <h2 id="_description">DESCRIPTION</h2>
431 <div class="sectionbody">
432 <div class="paragraph"><p>This merges the file listing in the directory cache index with the
433 actual working directory list, and shows different combinations of the
434 two.</p></div>
435 <div class="paragraph"><p>One or more of the options below may be used to determine the files
436 shown:</p></div>
437 </div>
438 <h2 id="_options">OPTIONS</h2>
439 <div class="sectionbody">
440 <div class="dlist"><dl>
441 <dt class="hdlist1">
443 </dt>
444 <dt class="hdlist1">
445 --cached
446 </dt>
447 <dd>
449 Show cached files in the output (default)
450 </p>
451 </dd>
452 <dt class="hdlist1">
454 </dt>
455 <dt class="hdlist1">
456 --deleted
457 </dt>
458 <dd>
460 Show deleted files in the output
461 </p>
462 </dd>
463 <dt class="hdlist1">
465 </dt>
466 <dt class="hdlist1">
467 --modified
468 </dt>
469 <dd>
471 Show modified files in the output
472 </p>
473 </dd>
474 <dt class="hdlist1">
476 </dt>
477 <dt class="hdlist1">
478 --others
479 </dt>
480 <dd>
482 Show other (i.e. untracked) files in the output
483 </p>
484 </dd>
485 <dt class="hdlist1">
487 </dt>
488 <dt class="hdlist1">
489 --ignored
490 </dt>
491 <dd>
493 Show only ignored files in the output. When showing files in the
494 index, print only those matched by an exclude pattern. When
495 showing "other" files, show only those matched by an exclude
496 pattern.
497 </p>
498 </dd>
499 <dt class="hdlist1">
501 </dt>
502 <dt class="hdlist1">
503 --stage
504 </dt>
505 <dd>
507 Show staged contents' object name, mode bits and stage number in the output.
508 </p>
509 </dd>
510 <dt class="hdlist1">
511 --directory
512 </dt>
513 <dd>
515 If a whole directory is classified as "other", show just its
516 name (with a trailing slash) and not its whole contents.
517 </p>
518 </dd>
519 <dt class="hdlist1">
520 --no-empty-directory
521 </dt>
522 <dd>
524 Do not list empty directories. Has no effect without --directory.
525 </p>
526 </dd>
527 <dt class="hdlist1">
529 </dt>
530 <dt class="hdlist1">
531 --unmerged
532 </dt>
533 <dd>
535 Show unmerged files in the output (forces --stage)
536 </p>
537 </dd>
538 <dt class="hdlist1">
540 </dt>
541 <dt class="hdlist1">
542 --killed
543 </dt>
544 <dd>
546 Show files on the filesystem that need to be removed due
547 to file/directory conflicts for checkout-index to
548 succeed.
549 </p>
550 </dd>
551 <dt class="hdlist1">
553 </dt>
554 <dd>
556 \0 line termination on output.
557 </p>
558 </dd>
559 <dt class="hdlist1">
560 -x &lt;pattern&gt;
561 </dt>
562 <dt class="hdlist1">
563 --exclude=&lt;pattern&gt;
564 </dt>
565 <dd>
567 Skip untracked files matching pattern.
568 Note that pattern is a shell wildcard pattern. See EXCLUDE PATTERNS
569 below for more information.
570 </p>
571 </dd>
572 <dt class="hdlist1">
573 -X &lt;file&gt;
574 </dt>
575 <dt class="hdlist1">
576 --exclude-from=&lt;file&gt;
577 </dt>
578 <dd>
580 Read exclude patterns from &lt;file&gt;; 1 per line.
581 </p>
582 </dd>
583 <dt class="hdlist1">
584 --exclude-per-directory=&lt;file&gt;
585 </dt>
586 <dd>
588 Read additional exclude patterns that apply only to the
589 directory and its subdirectories in &lt;file&gt;.
590 </p>
591 </dd>
592 <dt class="hdlist1">
593 --exclude-standard
594 </dt>
595 <dd>
597 Add the standard git exclusions: .git/info/exclude, .gitignore
598 in each directory, and the user&#8217;s global exclusion file.
599 </p>
600 </dd>
601 <dt class="hdlist1">
602 --error-unmatch
603 </dt>
604 <dd>
606 If any &lt;file&gt; does not appear in the index, treat this as an
607 error (return 1).
608 </p>
609 </dd>
610 <dt class="hdlist1">
611 --with-tree=&lt;tree-ish&gt;
612 </dt>
613 <dd>
615 When using --error-unmatch to expand the user supplied
616 &lt;file&gt; (i.e. path pattern) arguments to paths, pretend
617 that paths which were removed in the index since the
618 named &lt;tree-ish&gt; are still present. Using this option
619 with <tt>-s</tt> or <tt>-u</tt> options does not make any sense.
620 </p>
621 </dd>
622 <dt class="hdlist1">
624 </dt>
625 <dd>
627 This feature is semi-deprecated. For scripting purpose,
628 <a href="git-status.html">git-status(1)</a> <tt>--porcelain</tt> and
629 <a href="git-diff-files.html">git-diff-files(1)</a> <tt>--name-status</tt> are almost always
630 superior alternatives, and users should look at
631 <a href="git-status.html">git-status(1)</a> <tt>--short</tt> or <a href="git-diff.html">git-diff(1)</a>
632 <tt>--name-status</tt> for more user-friendly alternatives.
633 </p>
634 <div class="paragraph"><p>This option identifies the file status with the following tags (followed by
635 a space) at the start of each line:</p></div>
636 </dd>
637 <dt class="hdlist1">
639 </dt>
640 <dd>
642 cached
643 </p>
644 </dd>
645 <dt class="hdlist1">
647 </dt>
648 <dd>
650 skip-worktree
651 </p>
652 </dd>
653 <dt class="hdlist1">
655 </dt>
656 <dd>
658 unmerged
659 </p>
660 </dd>
661 <dt class="hdlist1">
663 </dt>
664 <dd>
666 removed/deleted
667 </p>
668 </dd>
669 <dt class="hdlist1">
671 </dt>
672 <dd>
674 modified/changed
675 </p>
676 </dd>
677 <dt class="hdlist1">
679 </dt>
680 <dd>
682 to be killed
683 </p>
684 </dd>
685 <dt class="hdlist1">
687 </dt>
688 <dd>
690 other
691 </p>
692 </dd>
693 <dt class="hdlist1">
695 </dt>
696 <dd>
698 Similar to <tt>-t</tt>, but use lowercase letters for files
699 that are marked as <em>assume unchanged</em> (see
700 <a href="git-update-index.html">git-update-index(1)</a>).
701 </p>
702 </dd>
703 <dt class="hdlist1">
704 --full-name
705 </dt>
706 <dd>
708 When run from a subdirectory, the command usually
709 outputs paths relative to the current directory. This
710 option forces paths to be output relative to the project
711 top directory.
712 </p>
713 </dd>
714 <dt class="hdlist1">
715 --abbrev[=&lt;n&gt;]
716 </dt>
717 <dd>
719 Instead of showing the full 40-byte hexadecimal object
720 lines, show only a partial prefix.
721 Non default number of digits can be specified with --abbrev=&lt;n&gt;.
722 </p>
723 </dd>
724 <dt class="hdlist1">
725 --debug
726 </dt>
727 <dd>
729 After each line that describes a file, add more data about its
730 cache entry. This is intended to show as much information as
731 possible for manual inspection; the exact format may change at
732 any time.
733 </p>
734 </dd>
735 <dt class="hdlist1">
737 </dt>
738 <dd>
740 Do not interpret any more arguments as options.
741 </p>
742 </dd>
743 <dt class="hdlist1">
744 &lt;file&gt;
745 </dt>
746 <dd>
748 Files to show. If no files are given all files which match the other
749 specified criteria are shown.
750 </p>
751 </dd>
752 </dl></div>
753 </div>
754 <h2 id="_output">Output</h2>
755 <div class="sectionbody">
756 <div class="paragraph"><p><em>git ls-files</em> just outputs the filenames unless <em>--stage</em> is specified in
757 which case it outputs:</p></div>
758 <div class="literalblock">
759 <div class="content">
760 <pre><tt>[&lt;tag&gt; ]&lt;mode&gt; &lt;object&gt; &lt;stage&gt; &lt;file&gt;</tt></pre>
761 </div></div>
762 <div class="paragraph"><p><em>git ls-files --unmerged</em> and <em>git ls-files --stage</em> can be used to examine
763 detailed information on unmerged paths.</p></div>
764 <div class="paragraph"><p>For an unmerged path, instead of recording a single mode/SHA1 pair,
765 the index records up to three such pairs; one from tree O in stage
766 1, A in stage 2, and B in stage 3. This information can be used by
767 the user (or the porcelain) to see what should eventually be recorded at the
768 path. (see <a href="git-read-tree.html">git-read-tree(1)</a> for more information on state)</p></div>
769 <div class="paragraph"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters
770 in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>,
771 respectively.</p></div>
772 </div>
773 <h2 id="_exclude_patterns">Exclude Patterns</h2>
774 <div class="sectionbody">
775 <div class="paragraph"><p><em>git ls-files</em> can use a list of "exclude patterns" when
776 traversing the directory tree and finding files to show when the
777 flags --others or --ignored are specified. <a href="gitignore.html">gitignore(5)</a>
778 specifies the format of exclude patterns.</p></div>
779 <div class="paragraph"><p>These exclude patterns come from these places, in order:</p></div>
780 <div class="olist arabic"><ol class="arabic">
781 <li>
783 The command line flag --exclude=&lt;pattern&gt; specifies a
784 single pattern. Patterns are ordered in the same order
785 they appear in the command line.
786 </p>
787 </li>
788 <li>
790 The command line flag --exclude-from=&lt;file&gt; specifies a
791 file containing a list of patterns. Patterns are ordered
792 in the same order they appear in the file.
793 </p>
794 </li>
795 <li>
797 The command line flag --exclude-per-directory=&lt;name&gt; specifies
798 a name of the file in each directory <em>git ls-files</em>
799 examines, normally <tt>.gitignore</tt>. Files in deeper
800 directories take precedence. Patterns are ordered in the
801 same order they appear in the files.
802 </p>
803 </li>
804 </ol></div>
805 <div class="paragraph"><p>A pattern specified on the command line with --exclude or read
806 from the file specified with --exclude-from is relative to the
807 top of the directory tree. A pattern read from a file specified
808 by --exclude-per-directory is relative to the directory that the
809 pattern file appears in.</p></div>
810 </div>
811 <h2 id="_see_also">SEE ALSO</h2>
812 <div class="sectionbody">
813 <div class="paragraph"><p><a href="git-read-tree.html">git-read-tree(1)</a>, <a href="gitignore.html">gitignore(5)</a></p></div>
814 </div>
815 <h2 id="_git">GIT</h2>
816 <div class="sectionbody">
817 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
818 </div>
819 <div id="footer">
820 <div id="footer-text">
821 Last updated 2011-03-15 23:30:14 UTC
822 </div>
823 </div>
824 </body>
825 </html>