1GIT-LS-TREE(1) Git Manual GIT-LS-TREE(1)
2
3
4
6 git-ls-tree - List the contents of a tree object
7
9 git-ls-tree [-d] [-r] [-t] [-l] [-z]
10 [--name-only] [--name-status] [--full-name] [--abbrev=[<n>]]
11 <tree-ish> [paths...]
12
14 Lists the contents of a given tree object, like what "/bin/ls -a" does
15 in the current working directory. Note that the usage is subtly
16 different, though - paths denote just a list of patterns to match, e.g.
17 so specifying directory name (without -r) will behave differently, and
18 order of the arguments does not matter.
19
21 <tree-ish>
22 Id of a tree-ish.
23
24 -d
25 Show only the named tree entry itself, not its children.
26
27 -r
28 Recurse into sub-trees.
29
30 -t
31 Show tree entries even when going to recurse them. Has no effect if
32 -r was not passed. -d implies -t.
33
34 -l, --long
35 Show object size of blob (file) entries.
36
37 -z
38 \0 line termination on output.
39
40 --name-only, --name-status
41 List only filenames (instead of the "long" output), one per line.
42
43 --abbrev[=<n>]
44 Instead of showing the full 40-byte hexadecimal object lines, show
45 only handful hexdigits prefix. Non default number of digits can be
46 specified with --abbrev=<n>.
47
48 --full-name
49 Instead of showing the path names relative to the current working
50 directory, show the full path names.
51
52 paths
53 When paths are given, show them (note that this isnĀ“t really raw
54 pathnames, but rather a list of patterns to match). Otherwise
55 implicitly uses the root level of the tree as the sole path
56 argument.
57
59 <mode> SP <type> SP <object> TAB <file>
60 When the -z option is not used, TAB, LF, and backslash characters in
61 pathnames are represented as \t, \n, and \\, respectively.
62
63 When the -l option is used, format changes to
64
65
66 <mode> SP <type> SP <object> SP <object size> TAB <file>
67 Object size identified by <object> is given in bytes, and
68 right-justified with minimum width of 7 characters. Object size is
69 given only for blobs (file) entries; for other entries - character is
70 used in place of size.
71
73 Written by Petr Baudis <pasky@suse.cz> Completely rewritten from
74 scratch by Junio C Hamano <junkio@cox.net>, another major rewrite by
75 Linus Torvalds <torvalds@osdl.org>
76
78 Documentation by David Greaves, Junio C Hamano and the git-list
79 <git@vger.kernel.org>.
80
82 Part of the git(7) suite
83
84
85
86
87Git 1.5.3.3 10/09/2007 GIT-LS-TREE(1)