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