1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
\r
4 <article lang="en" id="git-ls-files(1)">
\r
6 <title>git-ls-files(1)</title>
\r
8 <primary>git-ls-files(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-ls-files - Show information about files in the index and the working tree</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git ls-files</emphasis> [-z] [-t] [-v]
\r
19 (--[cached|deleted|others|ignored|stage|unmerged|killed|modified])*
\r
20 (-[c|d|o|i|s|u|k|m])*
\r
21 [-x <pattern>|--exclude=<pattern>]
\r
22 [-X <file>|--exclude-from=<file>]
\r
23 [--exclude-per-directory=<file>]
\r
24 [--exclude-standard]
\r
25 [--error-unmatch] [--with-tree=<tree-ish>]
\r
26 [--full-name] [--abbrev] [--] [<file>]\*</literallayout>
\r
29 <simplesect id="_description">
\r
30 <title>DESCRIPTION</title>
\r
31 <simpara>This merges the file listing in the directory cache index with the
\r
32 actual working directory list, and shows different combinations of the
\r
34 <simpara>One or more of the options below may be used to determine the files
\r
37 <simplesect id="_options">
\r
38 <title>OPTIONS</title>
\r
49 Show cached files in the output (default)
\r
62 Show deleted files in the output
\r
75 Show modified files in the output
\r
88 Show other files in the output
\r
101 Show ignored files in the output.
\r
102 Note that this also reverses any exclude list present.
\r
115 Show staged contents' object name, mode bits and stage number in the output.
\r
125 If a whole directory is classified as "other", show just its
\r
126 name (with a trailing slash) and not its whole contents.
\r
132 --no-empty-directory
\r
136 Do not list empty directories. Has no effect without --directory.
\r
149 Show unmerged files in the output (forces --stage)
\r
162 Show files on the filesystem that need to be removed due
\r
163 to file/directory conflicts for checkout-index to
\r
174 \0 line termination on output.
\r
183 --exclude=<pattern>
\r
187 Skips files matching pattern.
\r
188 Note that pattern is a shell wildcard pattern.
\r
197 --exclude-from=<file>
\r
201 exclude patterns are read from <file>; 1 per line.
\r
207 --exclude-per-directory=<file>
\r
211 read additional exclude patterns that apply only to the
\r
212 directory and its subdirectories in <file>.
\r
222 Add the standard git exclusions: .git/info/exclude, .gitignore
\r
223 in each directory, and the user’s global exclusion file.
\r
233 If any <file> does not appear in the index, treat this as an
\r
240 --with-tree=<tree-ish>
\r
244 When using --error-unmatch to expand the user supplied
\r
245 <file> (i.e. path pattern) arguments to paths, pretend
\r
246 that paths which were removed in the index since the
\r
247 named <tree-ish> are still present. Using this option
\r
248 with <literal>-s</literal> or <literal>-u</literal> options does not make any sense.
\r
258 Identify the file status with the following tags (followed by
\r
259 a space) at the start of each line:
\r
329 Similar to <literal>-t</literal>, but use lowercase letters for files
\r
330 that are marked as <emphasis>assume unchanged</emphasis> (see
\r
331 <xref linkend="git-update-index(1)"/>).
\r
341 When run from a subdirectory, the command usually
\r
342 outputs paths relative to the current directory. This
\r
343 option forces paths to be output relative to the project
\r
350 --abbrev[=<n>]
\r
354 Instead of showing the full 40-byte hexadecimal object
\r
355 lines, show only a partial prefix.
\r
356 Non default number of digits can be specified with --abbrev=<n>.
\r
366 Do not interpret any more arguments as options.
\r
376 Files to show. If no files are given all files which match the other
\r
377 specified criteria are shown.
\r
383 <simplesect id="_output">
\r
384 <title>Output</title>
\r
385 <simpara>show files just outputs the filename unless <emphasis>--stage</emphasis> is specified in
\r
386 which case it outputs:</simpara>
\r
387 <literallayout class="monospaced">[<tag> ]<mode> <object> <stage> <file></literallayout>
\r
388 <simpara><emphasis>git-ls-files --unmerged</emphasis> and <emphasis>git-ls-files --stage</emphasis> can be used to examine
\r
389 detailed information on unmerged paths.</simpara>
\r
390 <simpara>For an unmerged path, instead of recording a single mode/SHA1 pair,
\r
391 the index records up to three such pairs; one from tree O in stage
\r
392 1, A in stage 2, and B in stage 3. This information can be used by
\r
393 the user (or the porcelain) to see what should eventually be recorded at the
\r
394 path. (see <xref linkend="git-read-tree(1)"/> for more information on state)</simpara>
\r
395 <simpara>When <literal>-z</literal> option is not used, TAB, LF, and backslash characters
\r
396 in pathnames are represented as <literal>\t</literal>, <literal>\n</literal>, and <literal>\\</literal>,
\r
397 respectively.</simpara>
\r
399 <simplesect id="_exclude_patterns">
\r
400 <title>Exclude Patterns</title>
\r
401 <simpara><emphasis>git-ls-files</emphasis> can use a list of "exclude patterns" when
\r
402 traversing the directory tree and finding files to show when the
\r
403 flags --others or --ignored are specified. <xref linkend="gitignore(5)"/>
\r
404 specifies the format of exclude patterns.</simpara>
\r
405 <simpara>These exclude patterns come from these places, in order:</simpara>
\r
406 <orderedlist numeration="arabic">
\r
409 The command line flag --exclude=<pattern> specifies a
\r
410 single pattern. Patterns are ordered in the same order
\r
411 they appear in the command line.
\r
416 The command line flag --exclude-from=<file> specifies a
\r
417 file containing a list of patterns. Patterns are ordered
\r
418 in the same order they appear in the file.
\r
423 command line flag --exclude-per-directory=<name> specifies
\r
424 a name of the file in each directory <emphasis>git-ls-files</emphasis>
\r
425 examines, normally <literal>.gitignore</literal>. Files in deeper
\r
426 directories take precedence. Patterns are ordered in the
\r
427 same order they appear in the files.
\r
431 <simpara>A pattern specified on the command line with --exclude or read
\r
432 from the file specified with --exclude-from is relative to the
\r
433 top of the directory tree. A pattern read from a file specified
\r
434 by --exclude-per-directory is relative to the directory that the
\r
435 pattern file appears in.</simpara>
\r
437 <simplesect id="_see_also">
\r
438 <title>SEE ALSO</title>
\r
439 <simpara><xref linkend="git-read-tree(1)"/>, <xref linkend="gitignore(5)"/></simpara>
\r
441 <simplesect id="_author">
\r
442 <title>Author</title>
\r
443 <simpara>Written by Linus Torvalds <<ulink url="mailto:torvalds@osdl.org">torvalds@osdl.org</ulink>></simpara>
\r
445 <simplesect id="_documentation">
\r
446 <title>Documentation</title>
\r
447 <simpara>Documentation by David Greaves, Junio C Hamano, Josh Triplett, and the git-list <<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>>.</simpara>
\r
449 <simplesect id="_git">
\r
451 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r