'\" t
.\" Title: git-ls-tree
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 04/04/2016
.\" Manual: Git Manual
.\" Source: Git 2.8.0
.\" Language: English
.\"
.TH "GIT\-LS\-TREE" "1" "04/04/2016" "Git 2\&.8\&.0" "Git Manual"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git-ls-tree \- List the contents of a tree object
.SH "SYNOPSIS"
.sp
.nf
\fIgit ls\-tree\fR [\-d] [\-r] [\-t] [\-l] [\-z]
[\-\-name\-only] [\-\-name\-status] [\-\-full\-name] [\-\-full\-tree] [\-\-abbrev[=]]
[\&...]
.fi
.sp
.SH "DESCRIPTION"
.sp
Lists the contents of a given tree object, like what "/bin/ls \-a" does in the current working directory\&. Note that:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
the behaviour is slightly different from that of "/bin/ls" in that the
\fI\fR
denotes just a list of patterns to match, e\&.g\&. so specifying directory name (without
\fI\-r\fR) will behave differently, and order of the arguments does not matter\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
the behaviour is similar to that of "/bin/ls" in that the
\fI\fR
is taken as relative to the current working directory\&. E\&.g\&. when you are in a directory
\fIsub\fR
that has a directory
\fIdir\fR, you can run
\fIgit ls\-tree \-r HEAD dir\fR
to list the contents of the tree (that is
\fIsub/dir\fR
in
\fIHEAD\fR)\&. You don\(cqt want to give a tree that is not at the root level (e\&.g\&.
git ls\-tree \-r HEAD:sub dir) in this case, as that would result in asking for
\fIsub/sub/dir\fR
in the
\fIHEAD\fR
commit\&. However, the current working directory can be ignored by passing \-\-full\-tree option\&.
.RE
.SH "OPTIONS"
.PP
.RS 4
Id of a tree\-ish\&.
.RE
.PP
\-d
.RS 4
Show only the named tree entry itself, not its children\&.
.RE
.PP
\-r
.RS 4
Recurse into sub\-trees\&.
.RE
.PP
\-t
.RS 4
Show tree entries even when going to recurse them\&. Has no effect if
\fI\-r\fR
was not passed\&.
\fI\-d\fR
implies
\fI\-t\fR\&.
.RE
.PP
\-l, \-\-long
.RS 4
Show object size of blob (file) entries\&.
.RE
.PP
\-z
.RS 4
\e0 line termination on output\&.
.RE
.PP
\-\-name\-only, \-\-name\-status
.RS 4
List only filenames (instead of the "long" output), one per line\&.
.RE
.PP
\-\-abbrev[=]
.RS 4
Instead of showing the full 40\-byte hexadecimal object lines, show only a partial prefix\&. Non default number of digits can be specified with \-\-abbrev=\&.
.RE
.PP
\-\-full\-name
.RS 4
Instead of showing the path names relative to the current working directory, show the full path names\&.
.RE
.PP
\-\-full\-tree
.RS 4
Do not limit the listing to the current working directory\&. Implies \-\-full\-name\&.
.RE
.PP
[\&...]
.RS 4
When paths are given, show them (note that this isn\(cqt really raw pathnames, but rather a list of patterns to match)\&. Otherwise implicitly uses the root level of the tree as the sole path argument\&.
.RE
.SH "OUTPUT FORMAT"
.sp
.if n \{\
.RS 4
.\}
.nf
SP SP