OSDN Git Service

Add Git official document to help
[tortoisegit/TortoiseGitJp.git] / doc / source / en / TortoiseGit / git_doc / git-ls-tree.html.xml
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
3 \r
4 <article lang="en" id="git-ls-tree(1)">\r
5 <articleinfo>\r
6     <title>git-ls-tree(1)</title>\r
7         <indexterm>\r
8                 <primary>git-ls-tree(1)</primary>\r
9         </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-ls-tree - List the contents of a tree object</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git ls-tree</emphasis> [-d] [-r] [-t] [-l] [-z]\r
19             [--name-only] [--name-status] [--full-name] [--full-tree] [--abbrev=[&lt;n&gt;]]\r
20             &lt;tree-ish&gt; [paths&#8230;]</literallayout>\r
21 </blockquote>\r
22 </simplesect>\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
27 <itemizedlist>\r
28 <listitem>\r
29 <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
34 </simpara>\r
35 </listitem>\r
36 <listitem>\r
37 <simpara>\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&#8217;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
46    --full-tree option.\r
47 </simpara>\r
48 </listitem>\r
49 </itemizedlist>\r
50 </simplesect>\r
51 <simplesect id="_options">\r
52 <title>OPTIONS</title>\r
53 <variablelist>\r
54 <varlistentry>\r
55 <term>\r
56 &lt;tree-ish&gt;\r
57 </term>\r
58 <listitem>\r
59 <simpara>\r
60         Id of a tree-ish.\r
61 </simpara>\r
62 </listitem>\r
63 </varlistentry>\r
64 <varlistentry>\r
65 <term>\r
66 -d\r
67 </term>\r
68 <listitem>\r
69 <simpara>\r
70         Show only the named tree entry itself, not its children.\r
71 </simpara>\r
72 </listitem>\r
73 </varlistentry>\r
74 <varlistentry>\r
75 <term>\r
76 -r\r
77 </term>\r
78 <listitem>\r
79 <simpara>\r
80         Recurse into sub-trees.\r
81 </simpara>\r
82 </listitem>\r
83 </varlistentry>\r
84 <varlistentry>\r
85 <term>\r
86 -t\r
87 </term>\r
88 <listitem>\r
89 <simpara>\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
92 </simpara>\r
93 </listitem>\r
94 </varlistentry>\r
95 <varlistentry>\r
96 <term>\r
97 -l\r
98 </term>\r
99 <term>\r
100 --long\r
101 </term>\r
102 <listitem>\r
103 <simpara>\r
104         Show object size of blob (file) entries.\r
105 </simpara>\r
106 </listitem>\r
107 </varlistentry>\r
108 <varlistentry>\r
109 <term>\r
110 -z\r
111 </term>\r
112 <listitem>\r
113 <simpara>\r
114         \0 line termination on output.\r
115 </simpara>\r
116 </listitem>\r
117 </varlistentry>\r
118 <varlistentry>\r
119 <term>\r
120 --name-only\r
121 </term>\r
122 <term>\r
123 --name-status\r
124 </term>\r
125 <listitem>\r
126 <simpara>\r
127         List only filenames (instead of the "long" output), one per line.\r
128 </simpara>\r
129 </listitem>\r
130 </varlistentry>\r
131 <varlistentry>\r
132 <term>\r
133 --abbrev[=&lt;n&gt;]\r
134 </term>\r
135 <listitem>\r
136 <simpara>\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=&lt;n&gt;.\r
140 </simpara>\r
141 </listitem>\r
142 </varlistentry>\r
143 <varlistentry>\r
144 <term>\r
145 --full-name\r
146 </term>\r
147 <listitem>\r
148 <simpara>\r
149         Instead of showing the path names relative to the current working\r
150         directory, show the full path names.\r
151 </simpara>\r
152 </listitem>\r
153 </varlistentry>\r
154 <varlistentry>\r
155 <term>\r
156 --full-tree\r
157 </term>\r
158 <listitem>\r
159 <simpara>\r
160         Do not limit the listing to the current working directory.\r
161         Implies --full-name.\r
162 </simpara>\r
163 </listitem>\r
164 </varlistentry>\r
165 <varlistentry>\r
166 <term>\r
167 paths\r
168 </term>\r
169 <listitem>\r
170 <simpara>\r
171         When paths are given, show them (note that this isn&#8217;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
174 </simpara>\r
175 </listitem>\r
176 </varlistentry>\r
177 </variablelist>\r
178 </simplesect>\r
179 <simplesect id="_output_format">\r
180 <title>Output Format</title>\r
181 <literallayout class="monospaced">&lt;mode&gt; SP &lt;type&gt; SP &lt;object&gt; TAB &lt;file&gt;</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">&lt;mode&gt; SP &lt;type&gt; SP &lt;object&gt; SP &lt;object size&gt; TAB &lt;file&gt;</literallayout>\r
186 <simpara>Object size identified by &lt;object&gt; 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
189 </simplesect>\r
190 <simplesect id="_author">\r
191 <title>Author</title>\r
192 <simpara>Written by Petr Baudis &lt;<ulink url="mailto:pasky@suse.cz">pasky@suse.cz</ulink>&gt;\r
193 Completely rewritten from scratch by Junio C Hamano &lt;<ulink url="mailto:gitster@pobox.com">gitster@pobox.com</ulink>&gt;,\r
194 another major rewrite by Linus Torvalds &lt;<ulink url="mailto:torvalds@osdl.org">torvalds@osdl.org</ulink>&gt;</simpara>\r
195 </simplesect>\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 &lt;<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>&gt;.</simpara>\r
200 </simplesect>\r
201 <simplesect id="_git">\r
202 <title>GIT</title>\r
203 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>\r
204 </simplesect>\r
205 </article>\r