Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-ls-tree(1) |
| 2 | ============== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 6 | git-ls-tree - List the contents of a tree object |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | 33db437 | 2006-06-07 19:51:45 | [diff] [blame] | 11 | [verse] |
Junio C Hamano | 7fd8417 | 2007-05-24 07:00:32 | [diff] [blame] | 12 | 'git-ls-tree' [-d] [-r] [-t] [-l] [-z] |
Junio C Hamano | 33db437 | 2006-06-07 19:51:45 | [diff] [blame] | 13 | [--name-only] [--name-status] [--full-name] [--abbrev=[<n>]] |
| 14 | <tree-ish> [paths...] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 15 | |
| 16 | DESCRIPTION |
| 17 | ----------- |
| 18 | Lists the contents of a given tree object, like what "/bin/ls -a" does |
| 19 | in the current working directory. Note that the usage is subtly different, |
| 20 | though - 'paths' denote just a list of patterns to match, e.g. so specifying |
| 21 | directory name (without '-r') will behave differently, and order of the |
| 22 | arguments does not matter. |
| 23 | |
| 24 | OPTIONS |
| 25 | ------- |
| 26 | <tree-ish>:: |
| 27 | Id of a tree-ish. |
| 28 | |
| 29 | -d:: |
| 30 | Show only the named tree entry itself, not its children. |
| 31 | |
| 32 | -r:: |
| 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'. |
| 38 | |
Junio C Hamano | 7fd8417 | 2007-05-24 07:00:32 | [diff] [blame] | 39 | -l:: |
| 40 | --long:: |
| 41 | Show object size of blob (file) entries. |
| 42 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 43 | -z:: |
| 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. |
| 49 | |
Junio C Hamano | 5c3957e | 2006-03-28 00:28:01 | [diff] [blame] | 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 | |
Junio C Hamano | 33db437 | 2006-06-07 19:51:45 | [diff] [blame] | 55 | --full-name:: |
Junio C Hamano | f1d1480 | 2006-06-08 00:48:17 | [diff] [blame] | 56 | Instead of showing the path names relative to the current working |
Junio C Hamano | 33db437 | 2006-06-07 19:51:45 | [diff] [blame] | 57 | directory, show the full path names. |
| 58 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 59 | paths:: |
| 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. |
| 63 | |
| 64 | |
| 65 | Output Format |
| 66 | ------------- |
| 67 | <mode> SP <type> SP <object> TAB <file> |
| 68 | |
| 69 | When the `-z` option is not used, TAB, LF, and backslash characters |
| 70 | in pathnames are represented as `\t`, `\n`, and `\\`, respectively. |
| 71 | |
Junio C Hamano | 7fd8417 | 2007-05-24 07:00:32 | [diff] [blame] | 72 | When the `-l` option is used, format changes to |
| 73 | |
| 74 | <mode> SP <type> SP <object> SP <object size> TAB <file> |
| 75 | |
| 76 | Object size identified by <object> is given in bytes, and right-justified |
| 77 | with 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 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 80 | |
| 81 | Author |
| 82 | ------ |
| 83 | Written by Petr Baudis <pasky@suse.cz> |
| 84 | Completely rewritten from scratch by Junio C Hamano <junkio@cox.net>, |
| 85 | another major rewrite by Linus Torvalds <torvalds@osdl.org> |
| 86 | |
| 87 | Documentation |
| 88 | -------------- |
| 89 | Documentation by David Greaves, Junio C Hamano and the git-list |
| 90 | <git@vger.kernel.org>. |
| 91 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 92 | GIT |
| 93 | --- |
| 94 | Part of the gitlink:git[7] suite |