018c4019532d9eb18dcae4873cd641604e833779
[git.git] / Documentation / git-ls-tree.txt
1 git-ls-tree(1)
2 ==============
3
4 NAME
5 ----
6 git-ls-tree - Lists the contents of a tree object
7
8
9 SYNOPSIS
10 --------
11 'git-ls-tree' [-d] [-r] [-t] [-z]
12         [--name-only] [--name-status] [--full-name] [--abbrev=[<n>]]
13         <tree-ish> [paths...]
14
15 DESCRIPTION
16 -----------
17 Lists the contents of a given tree object, like what "/bin/ls -a" does
18 in the current working directory. Note that the usage is subtly different,
19 though - 'paths' denote just a list of patterns to match, e.g. so specifying
20 directory name (without '-r') will behave differently, and order of the
21 arguments does not matter.
22
23 OPTIONS
24 -------
25 <tree-ish>::
26         Id of a tree-ish.
27
28 -d::
29         Show only the named tree entry itself, not its children.
30
31 -r::
32         Recurse into sub-trees.
33
34 -t::
35         Show tree entries even when going to recurse them. Has no effect
36         if '-r' was not passed. '-d' implies '-t'.
37
38 -z::
39         \0 line termination on output.
40
41 --name-only::
42 --name-status::
43         List only filenames (instead of the "long" output), one per line.
44
45 --abbrev[=<n>]::
46         Instead of showing the full 40-byte hexadecimal object
47         lines, show only handful hexdigits prefix.
48         Non default number of digits can be specified with --abbrev=<n>.
49
50 paths::
51         When paths are given, show them (note that this isn't really raw
52         pathnames, but rather a list of patterns to match).  Otherwise
53         implicitly uses the root level of the tree as the sole path argument.
54
55
56 Output Format
57 -------------
58         <mode> SP <type> SP <object> TAB <file>
59
60 When the `-z` option is not used, TAB, LF, and backslash characters
61 in pathnames are represented as `\t`, `\n`, and `\\`, respectively.
62
63
64 Author
65 ------
66 Written by Petr Baudis <pasky@suse.cz>
67 Completely rewritten from scratch by Junio C Hamano <junkio@cox.net>,
68 another major rewrite by Linus Torvalds <torvalds@osdl.org>
69
70 Documentation
71 --------------
72 Documentation by David Greaves, Junio C Hamano and the git-list
73 <git@vger.kernel.org>.
74
75 This manual page is a stub. You can help the git documentation by expanding it.
76
77 GIT
78 ---
79 Part of the gitlink:git[7] suite
80