blob: 8689cdee536d95ba527792a87467243669a6a5e5 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.0.2" />
<style type="text/css">
/* Debug borders */
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
/*
border: 1px solid red;
*/
}
body {
margin: 1em 5% 1em 5%;
}
a { color: blue; }
a:visited { color: fuchsia; }
em {
font-style: italic;
}
strong {
font-weight: bold;
}
tt {
color: navy;
}
h1, h2, h3, h4, h5, h6 {
color: #527bbd;
font-family: sans-serif;
margin-top: 1.2em;
margin-bottom: 0.5em;
line-height: 1.3;
}
h1 {
border-bottom: 2px solid silver;
}
h2 {
border-bottom: 2px solid silver;
padding-top: 0.5em;
}
div.sectionbody {
font-family: serif;
margin-left: 0;
}
hr {
border: 1px solid silver;
}
p {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
pre {
padding: 0;
margin: 0;
}
span#author {
color: #527bbd;
font-family: sans-serif;
font-weight: bold;
font-size: 1.2em;
}
span#email {
}
span#revision {
font-family: sans-serif;
}
div#footer {
font-family: sans-serif;
font-size: small;
border-top: 2px solid silver;
padding-top: 0.5em;
margin-top: 4.0em;
}
div#footer-text {
float: left;
padding-bottom: 0.5em;
}
div#footer-badges {
float: right;
padding-bottom: 0.5em;
}
div#preamble,
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
margin-right: 10%;
margin-top: 1.5em;
margin-bottom: 1.5em;
}
div.admonitionblock {
margin-top: 2.5em;
margin-bottom: 2.5em;
}
div.content { /* Block element content. */
padding: 0;
}
/* Block element titles. */
div.title, caption.title {
font-family: sans-serif;
font-weight: bold;
text-align: left;
margin-top: 1.0em;
margin-bottom: 0.5em;
}
div.title + * {
margin-top: 0;
}
td div.title:first-child {
margin-top: 0.0em;
}
div.content div.title:first-child {
margin-top: 0.0em;
}
div.content + div.title {
margin-top: 0.0em;
}
div.sidebarblock > div.content {
background: #ffffee;
border: 1px solid silver;
padding: 0.5em;
}
div.listingblock > div.content {
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}
div.quoteblock > div.content {
padding-left: 2.0em;
}
div.quoteblock .attribution {
text-align: right;
}
div.admonitionblock .icon {
vertical-align: top;
font-size: 1.1em;
font-weight: bold;
text-decoration: underline;
color: #527bbd;
padding-right: 0.5em;
}
div.admonitionblock td.content {
padding-left: 0.5em;
border-left: 2px solid silver;
}
div.exampleblock > div.content {
border-left: 2px solid silver;
padding: 0.5em;
}
div.verseblock div.content {
white-space: pre;
}
div.imageblock div.content { padding-left: 0; }
div.imageblock img { border: 1px solid silver; }
span.image img { border-style: none; }
dl {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
dt {
margin-top: 0.5em;
margin-bottom: 0;
font-style: italic;
}
dd > *:first-child {
margin-top: 0;
}
ul, ol {
list-style-position: outside;
}
ol.olist2 {
list-style-type: lower-alpha;
}
div.tableblock > table {
border-color: #527bbd;
border-width: 3px;
}
thead {
font-family: sans-serif;
font-weight: bold;
}
tfoot {
font-weight: bold;
}
div.hlist {
margin-top: 0.8em;
margin-bottom: 0.8em;
}
td.hlist1 {
vertical-align: top;
font-style: italic;
padding-right: 0.8em;
}
td.hlist2 {
vertical-align: top;
}
@media print {
div#footer-badges { display: none; }
}
include::./stylesheets/xhtml11-manpage.css[]
/* Workarounds for IE6's broken and incomplete CSS2. */
div.sidebar-content {
background: #ffffee;
border: 1px solid silver;
padding: 0.5em;
}
div.sidebar-title, div.image-title {
font-family: sans-serif;
font-weight: bold;
margin-top: 0.0em;
margin-bottom: 0.5em;
}
div.listingblock div.content {
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}
div.quoteblock-content {
padding-left: 2.0em;
}
div.exampleblock-content {
border-left: 2px solid silver;
padding-left: 0.5em;
}
</style>
<title>git-ls-files(1)</title>
</head>
<body>
<div id="header">
<h1>
git-ls-files(1) Manual Page
</h1>
<h2>NAME</h2>
<div class="sectionbody">
<p>git-ls-files -
Show information about files in the index and the working tree
</p>
</div>
</div>
<h2>SYNOPSIS</h2>
<div class="sectionbody">
<div class="verseblock">
<div class="content"><em>git-ls-files</em> [-z] [-t] [-v]
(--[cached|deleted|others|ignored|stage|unmerged|killed|modified])*
(-[c|d|o|i|s|u|k|m])*
[-x &lt;pattern&gt;|--exclude=&lt;pattern&gt;]
[-X &lt;file&gt;|--exclude-from=&lt;file&gt;]
[--exclude-per-directory=&lt;file&gt;]
[--error-unmatch] [--with-tree=&lt;tree-ish&gt;]
[--full-name] [--abbrev] [--] [&lt;file&gt;]*</div></div>
</div>
<h2>DESCRIPTION</h2>
<div class="sectionbody">
<p>This merges the file listing in the directory cache index with the
actual working directory list, and shows different combinations of the
two.</p>
<p>One or more of the options below may be used to determine the files
shown:</p>
</div>
<h2>OPTIONS</h2>
<div class="sectionbody">
<dl>
<dt>
-c|--cached
</dt>
<dd>
<p>
Show cached files in the output (default)
</p>
</dd>
<dt>
-d|--deleted
</dt>
<dd>
<p>
Show deleted files in the output
</p>
</dd>
<dt>
-m|--modified
</dt>
<dd>
<p>
Show modified files in the output
</p>
</dd>
<dt>
-o|--others
</dt>
<dd>
<p>
Show other files in the output
</p>
</dd>
<dt>
-i|--ignored
</dt>
<dd>
<p>
Show ignored files in the output.
Note that this also reverses any exclude list present.
</p>
</dd>
<dt>
-s|--stage
</dt>
<dd>
<p>
Show stage files in the output
</p>
</dd>
<dt>
--directory
</dt>
<dd>
<p>
If a whole directory is classified as "other", show just its
name (with a trailing slash) and not its whole contents.
</p>
</dd>
<dt>
--no-empty-directory
</dt>
<dd>
<p>
Do not list empty directories. Has no effect without --directory.
</p>
</dd>
<dt>
-u|--unmerged
</dt>
<dd>
<p>
Show unmerged files in the output (forces --stage)
</p>
</dd>
<dt>
-k|--killed
</dt>
<dd>
<p>
Show files on the filesystem that need to be removed due
to file/directory conflicts for checkout-index to
succeed.
</p>
</dd>
<dt>
-z
</dt>
<dd>
<p>
\0 line termination on output.
</p>
</dd>
<dt>
-x|--exclude=&lt;pattern&gt;
</dt>
<dd>
<p>
Skips files matching pattern.
Note that pattern is a shell wildcard pattern.
</p>
</dd>
<dt>
-X|--exclude-from=&lt;file&gt;
</dt>
<dd>
<p>
exclude patterns are read from &lt;file&gt;; 1 per line.
</p>
</dd>
<dt>
--exclude-per-directory=&lt;file&gt;
</dt>
<dd>
<p>
read additional exclude patterns that apply only to the
directory and its subdirectories in &lt;file&gt;.
</p>
</dd>
<dt>
--error-unmatch
</dt>
<dd>
<p>
If any &lt;file&gt; does not appear in the index, treat this as an
error (return 1).
</p>
</dd>
<dt>
--with-tree=&lt;tree-ish&gt;
</dt>
<dd>
<p>
When using --error-unmatch to expand the user supplied
&lt;file&gt; (i.e. path pattern) arguments to paths, pretend
that paths which were removed in the index since the
named &lt;tree-ish&gt; are still present. Using this option
with <tt>-s</tt> or <tt>-u</tt> options does not make any sense.
</p>
</dd>
<dt>
-t
</dt>
<dd>
<p>
Identify the file status with the following tags (followed by
a space) at the start of each line:
</p>
<div class="hlist"><table>
<tr>
<td class="hlist1">
H
</td>
<td class="hlist2">
cached
</td>
</tr>
<tr>
<td class="hlist1">
M
</td>
<td class="hlist2">
unmerged
</td>
</tr>
<tr>
<td class="hlist1">
R
</td>
<td class="hlist2">
removed/deleted
</td>
</tr>
<tr>
<td class="hlist1">
C
</td>
<td class="hlist2">
modified/changed
</td>
</tr>
<tr>
<td class="hlist1">
K
</td>
<td class="hlist2">
to be killed
</td>
</tr>
<tr>
<td class="hlist1">
?
</td>
<td class="hlist2">
other
</td>
</tr>
</table></div>
</dd>
<dt>
-v
</dt>
<dd>
<p>
Similar to <tt>-t</tt>, but use lowercase letters for files
that are marked as <em>always matching index</em>.
</p>
</dd>
<dt>
--full-name
</dt>
<dd>
<p>
When run from a subdirectory, the command usually
outputs paths relative to the current directory. This
option forces paths to be output relative to the project
top directory.
</p>
</dd>
<dt>
--abbrev[=&lt;n&gt;]
</dt>
<dd>
<p>
Instead of showing the full 40-byte hexadecimal object
lines, show only handful hexdigits prefix.
Non default number of digits can be specified with --abbrev=&lt;n&gt;.
</p>
</dd>
<dt>
--
</dt>
<dd>
<p>
Do not interpret any more arguments as options.
</p>
</dd>
<dt>
&lt;file&gt;
</dt>
<dd>
<p>
Files to show. If no files are given all files which match the other
specified criteria are shown.
</p>
</dd>
</dl>
</div>
<h2>Output</h2>
<div class="sectionbody">
<p>show files just outputs the filename unless <em>--stage</em> is specified in
which case it outputs:</p>
<div class="literalblock">
<div class="content">
<pre><tt>[&lt;tag&gt; ]&lt;mode&gt; &lt;object&gt; &lt;stage&gt; &lt;file&gt;</tt></pre>
</div></div>
<p>"git-ls-files --unmerged" and "git-ls-files --stage" can be used to examine
detailed information on unmerged paths.</p>
<p>For an unmerged path, instead of recording a single mode/SHA1 pair,
the index records up to three such pairs; one from tree O in stage
1, A in stage 2, and B in stage 3. This information can be used by
the user (or the porcelain) to see what should eventually be recorded at the
path. (see git-read-tree for more information on state)</p>
<p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters
in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>,
respectively.</p>
</div>
<h2>Exclude Patterns</h2>
<div class="sectionbody">
<p><em>git-ls-files</em> can use a list of "exclude patterns" when
traversing the directory tree and finding files to show when the
flags --others or --ignored are specified. <a href="gitignore.html">gitignore(5)</a>
specifies the format of exclude patterns.</p>
<p>These exclude patterns come from these places, in order:</p>
<ol>
<li>
<p>
The command line flag --exclude=&lt;pattern&gt; specifies a
single pattern. Patterns are ordered in the same order
they appear in the command line.
</p>
</li>
<li>
<p>
The command line flag --exclude-from=&lt;file&gt; specifies a
file containing a list of patterns. Patterns are ordered
in the same order they appear in the file.
</p>
</li>
<li>
<p>
command line flag --exclude-per-directory=&lt;name&gt; specifies
a name of the file in each directory <em>git-ls-files</em>
examines, normally <tt>.gitignore</tt>. Files in deeper
directories take precedence. Patterns are ordered in the
same order they appear in the files.
</p>
</li>
</ol>
<p>A pattern specified on the command line with --exclude or read
from the file specified with --exclude-from is relative to the
top of the directory tree. A pattern read from a file specified
by --exclude-per-directory is relative to the directory that the
pattern file appears in.</p>
</div>
<h2>See Also</h2>
<div class="sectionbody">
<p><a href="git-read-tree.html">git-read-tree(1)</a>, <a href="gitignore.html">gitignore(5)</a></p>
</div>
<h2>Author</h2>
<div class="sectionbody">
<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p>
</div>
<h2>Documentation</h2>
<div class="sectionbody">
<p>Documentation by David Greaves, Junio C Hamano, Josh Triplett, and the git-list &lt;git@vger.kernel.org&gt;.</p>
</div>
<h2>GIT</h2>
<div class="sectionbody">
<p>Part of the <a href="git.html">git(7)</a> suite</p>
</div>
<div id="footer">
<div id="footer-text">
Last updated 14-Nov-2007 12:11:35 UTC
</div>
</div>
</body>
</html>