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-tree(1)">
\r
6 <title>git-ls-tree(1)</title>
\r
8 <primary>git-ls-tree(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-ls-tree - List the contents of a tree object</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git ls-tree</emphasis> [-d] [-r] [-t] [-l] [-z]
\r
19 [--name-only] [--name-status] [--full-name] [--full-tree] [--abbrev=[<n>]]
\r
20 <tree-ish> [paths…]</literallayout>
\r
23 <simplesect id="_description">
\r
24 <title>DESCRIPTION</title>
\r
25 <simpara>Lists the contents of a given tree object, like what "/bin/ls -a" does
\r
26 in the current working directory. Note that:</simpara>
\r
30 the behaviour is slightly different from that of "/bin/ls" in that the
\r
31 <emphasis>paths</emphasis> denote just a list of patterns to match, e.g. so specifying
\r
32 directory name (without <emphasis>-r</emphasis>) will behave differently, and order of the
\r
33 arguments does not matter.
\r
38 the behaviour is similar to that of "/bin/ls" in that the <emphasis>paths</emphasis> is
\r
39 taken as relative to the current working directory. E.g. when you are
\r
40 in a directory <emphasis>sub</emphasis> that has a directory <emphasis>dir</emphasis>, you can run <emphasis>git
\r
41 ls-tree -r HEAD dir</emphasis> to list the contents of the tree (that is
\r
42 <emphasis>sub/dir</emphasis> in <emphasis>HEAD</emphasis>). You don’t want to give a tree that is not at the
\r
43 root level (e.g. <emphasis>git ls-tree -r HEAD:sub dir</emphasis>) in this case, as that
\r
44 would result in asking for <emphasis>sub/sub/dir</emphasis> in the <emphasis>HEAD</emphasis> commit.
\r
45 However, the current working directory can be ignored by passing
\r
51 <simplesect id="_options">
\r
52 <title>OPTIONS</title>
\r
70 Show only the named tree entry itself, not its children.
\r
80 Recurse into sub-trees.
\r
90 Show tree entries even when going to recurse them. Has no effect
\r
91 if <emphasis>-r</emphasis> was not passed. <emphasis>-d</emphasis> implies <emphasis>-t</emphasis>.
\r
104 Show object size of blob (file) entries.
\r
114 \0 line termination on output.
\r
127 List only filenames (instead of the "long" output), one per line.
\r
133 --abbrev[=<n>]
\r
137 Instead of showing the full 40-byte hexadecimal object
\r
138 lines, show only a partial prefix.
\r
139 Non default number of digits can be specified with --abbrev=<n>.
\r
149 Instead of showing the path names relative to the current working
\r
150 directory, show the full path names.
\r
160 Do not limit the listing to the current working directory.
\r
161 Implies --full-name.
\r
171 When paths are given, show them (note that this isn’t really raw
\r
172 pathnames, but rather a list of patterns to match). Otherwise
\r
173 implicitly uses the root level of the tree as the sole path argument.
\r
179 <simplesect id="_output_format">
\r
180 <title>Output Format</title>
\r
181 <literallayout class="monospaced"><mode> SP <type> SP <object> TAB <file></literallayout>
\r
182 <simpara>When the <literal>-z</literal> option is not used, TAB, LF, and backslash characters
\r
183 in pathnames are represented as <literal>\t</literal>, <literal>\n</literal>, and <literal>\\</literal>, respectively.</simpara>
\r
184 <simpara>When the <literal>-l</literal> option is used, format changes to</simpara>
\r
185 <literallayout class="monospaced"><mode> SP <type> SP <object> SP <object size> TAB <file></literallayout>
\r
186 <simpara>Object size identified by <object> is given in bytes, and right-justified
\r
187 with minimum width of 7 characters. Object size is given only for blobs
\r
188 (file) entries; for other entries <literal>-</literal> character is used in place of size.</simpara>
\r
190 <simplesect id="_author">
\r
191 <title>Author</title>
\r
192 <simpara>Written by Petr Baudis <<ulink url="mailto:pasky@suse.cz">pasky@suse.cz</ulink>>
\r
193 Completely rewritten from scratch by Junio C Hamano <<ulink url="mailto:gitster@pobox.com">gitster@pobox.com</ulink>>,
\r
194 another major rewrite by Linus Torvalds <<ulink url="mailto:torvalds@osdl.org">torvalds@osdl.org</ulink>></simpara>
\r
196 <simplesect id="_documentation">
\r
197 <title>Documentation</title>
\r
198 <simpara>Documentation by David Greaves, Junio C Hamano and the git-list
\r
199 <<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>>.</simpara>
\r
201 <simplesect id="_git">
\r
203 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r