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">
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">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.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
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.5em;
129 div
.content
{ /* Block element content. */
133 /* Block element titles. */
134 div
.title
, caption
.title
{
136 font-family: sans-serif
;
140 margin-bottom: 0.5em;
146 td div
.title:first-child
{
149 div
.content div
.title:first-child
{
152 div
.content
+ div
.title
{
156 div
.sidebarblock
> div
.content
{
158 border: 1px solid silver
;
162 div
.listingblock
> div
.content
{
163 border: 1px solid silver
;
172 div
.quoteblock
> div
.attribution
{
181 div
.verseblock
> div
.content
{
184 div
.verseblock
> div
.attribution
{
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div
.verseblock
+ div
.attribution
{
193 div
.admonitionblock
.icon
{
197 text-decoration: underline
;
199 padding-right: 0.5em;
201 div
.admonitionblock td
.content
{
203 border-left: 2px solid silver
;
206 div
.exampleblock
> div
.content
{
207 border-left: 2px solid silver
;
211 div
.imageblock div
.content
{ padding-left: 0; }
212 span
.image img
{ border-style: none
; }
213 a
.image:visited
{ color: white
; }
217 margin-bottom: 0.8em;
230 list-style-position: outside
;
233 list-style-type: decimal
;
236 list-style-type: lower-alpha
;
239 list-style-type: upper-alpha
;
242 list-style-type: lower-roman
;
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
{
252 margin-bottom: 0.1em;
255 div
.tableblock
> table
{
256 border: 3px solid
#527bbd;
259 font-family: sans-serif
;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div
.tableblock
> table
[frame
="void"] {
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
;
287 margin-bottom: 0.8em;
290 padding-bottom: 15px;
292 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
298 padding-right: 0.8em;
304 div
.hdlist
.compact tr
{
314 div#footer-badges
{ display: none
; }
319 font-family: sans-serif
;
323 margin-bottom: 0.1em;
326 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
342 /* Overrides for manpage documents */
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver
;
347 border-bottom: 2px solid silver
;
357 div#toc
{ display: none
; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div
.sidebar-content
{
364 border: 1px solid silver
;
367 div
.sidebar-title
, div
.image-title
{
369 font-family: sans-serif
;
372 margin-bottom: 0.5em;
375 div
.listingblock div
.content
{
376 border: 1px solid silver
;
381 div
.quoteblock-attribution
{
386 div
.verseblock-content
{
389 div
.verseblock-attribution
{
394 div
.exampleblock-content
{
395 border-left: 2px solid silver
;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc
a:visited
{ color: blue
; }
406 git-ls-files(
1) Manual Page
409 <div class=
"sectionbody">
411 Show information about files in the index and the working tree
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
<pattern
>|--exclude=
<pattern
>]
422 [-X
<file
>|--exclude-from=
<file
>]
423 [--exclude-per-directory=
<file
>]
425 [--error-unmatch] [--with-tree=
<tree-ish
>]
426 [--full-name] [--abbrev] [--] [
<file
>…]
</div>
427 <div class=
"verseblock-attribution">
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
435 <div class=
"paragraph"><p>One or more of the options below may be used to determine the files
438 <h2 id=
"_options">OPTIONS
</h2>
439 <div class=
"sectionbody">
440 <div class=
"dlist"><dl>
449 Show cached files in the output (default)
460 Show deleted files in the output
471 Show modified files in the output
482 Show other (i.e. untracked) files in the output
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
507 Show staged contents' object name, mode bits and stage number in the output.
515 If a whole directory is classified as
"other", show just its
516 name (with a trailing slash) and not its whole contents.
524 Do not list empty directories. Has no effect without --directory.
535 Show unmerged files in the output (forces --stage)
546 Show files on the filesystem that need to be removed due
547 to file/directory conflicts for checkout-index to
556 \
0 line termination on output.
563 --exclude=
<pattern
>
567 Skip untracked files matching pattern.
568 Note that pattern is a shell wildcard pattern. See EXCLUDE PATTERNS
569 below for more information.
576 --exclude-from=
<file
>
580 Read exclude patterns from
<file
>;
1 per line.
584 --exclude-per-directory=
<file
>
588 Read additional exclude patterns that apply only to the
589 directory and its subdirectories in
<file
>.
597 Add the standard git exclusions: .git/info/exclude, .gitignore
598 in each directory, and the user
’s global exclusion file.
606 If any
<file
> does not appear in the index, treat this as an
611 --with-tree=
<tree-ish
>
615 When using --error-unmatch to expand the user supplied
616 <file
> (i.e. path pattern) arguments to paths, pretend
617 that paths which were removed in the index since the
618 named
<tree-ish
> are still present. Using this option
619 with
<tt>-s
</tt> or
<tt>-u
</tt> options does not make any sense.
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.
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>
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>).
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
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=
<n
>.
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
740 Do not interpret any more arguments as options.
748 Files to show. If no files are given all files which match the other
749 specified criteria are shown.
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>[
<tag
> ]
<mode
> <object
> <stage
> <file
></tt></pre>
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>
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">
783 The command line flag --exclude=
<pattern
> specifies a
784 single pattern. Patterns are ordered in the same order
785 they appear in the command line.
790 The command line flag --exclude-from=
<file
> specifies a
791 file containing a list of patterns. Patterns are ordered
792 in the same order they appear in the file.
797 The command line flag --exclude-per-directory=
<name
> 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.
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>
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>
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>
820 <div id=
"footer-text">
821 Last updated
2011-
03-
15 23:
30:
14 UTC