[PATCH 1/4] split core-git.txt and update
[git/gitweb.git] / Documentation / git-ls-files.txt
blob2face87ae5ff5e7822682e0cfb64011ea296352d
1 git-ls-files(1)
2 ===============
3 v0.1, May 2005
5 NAME
6 ----
7 git-ls-files - Information about files in the cache/working directory
10 SYNOPSIS
11 --------
12 'git-ls-files' [-z] [-t]
13                 (--[cached|deleted|others|ignored|stage|unmerged])\*
14                 (-[c|d|o|i|s|u])\*
15                 [-x <pattern>|--exclude=<pattern>]
16                 [-X <file>|--exclude-from=<file>]
18 DESCRIPTION
19 -----------
20 This merges the file listing in the directory cache index with the
21 actual working directory list, and shows different combinations of the
22 two.
24 One or more of the options below may be used to determine the files
25 shown:
27 OPTIONS
28 -------
29 -c|--cached::
30         Show cached files in the output (default)
32 -d|--deleted::
33         Show deleted files in the output
35 -o|--others::
36         Show other files in the output
38 -i|--ignored::
39         Show ignored files in the output
40         Note the this also reverses any exclude list present.
42 -s|--stage::
43         Show stage files in the output
45 -u|--unmerged::
46         Show unmerged files in the output (forces --stage)
48 -z::
49         \0 line termination on output
51 -x|--exclude=<pattern>::
52         Skips files matching pattern.
53         Note that pattern is a shell wildcard pattern.
55 -X|--exclude-from=<file>::
56         exclude patterns are read from <file>; 1 per line.
57         Allows the use of the famous dontdiff file as follows to find
58         out about uncommitted files just as dontdiff is used with
59         the diff command:
60              git-ls-files --others --exclude-from=dontdiff
62 -t::
63         Identify the file status with the following tags (followed by
64         a space) at the start of each line:
65         H       cached
66         M       unmerged
67         R       removed/deleted
68         ?       other
70 Output
71 ------
72 show files just outputs the filename unless '--stage' is specified in
73 which case it outputs:
75         [<tag> ]<mode> <object> <stage> <file>
77 "git-ls-files --unmerged" and "git-ls-files --stage" can be used to examine
78 detailed information on unmerged paths.
80 For an unmerged path, instead of recording a single mode/SHA1 pair,
81 the dircache records up to three such pairs; one from tree O in stage
82 1, A in stage 2, and B in stage 3.  This information can be used by
83 the user (or Cogito) to see what should eventually be recorded at the
84 path. (see read-cache for more information on state)
86 see also: link:read-cache.html[read-cache]
89 Author
90 ------
91 Written by Linus Torvalds <torvalds@osdl.org>
93 Documentation
94 --------------
95 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
97 GIT
98 ---
99 Part of the link:git.html[git] suite