@@ -12,6 +12,7 @@ SYNOPSIS
12
12
'git ls-files' [-z] [-t] [-v] [-f]
13
13
[-c|--cached] [-d|--deleted] [-o|--others] [-i|--ignored]
14
14
[-s|--stage] [-u|--unmerged] [-k|--killed] [-m|--modified]
15
+ [--resolve-undo]
15
16
[--directory [--no-empty-directory]] [--eol]
16
17
[--deduplicate]
17
18
[-x <pattern>|--exclude=<pattern>]
@@ -28,33 +29,41 @@ This merges the file listing in the index with the actual working
28
29
directory list, and shows different combinations of the two.
29
30
30
31
One or more of the options below may be used to determine the files
31
- shown:
32
+ shown, and each file may be printed multiple times if there are
33
+ multiple entries in the index or multiple statuses are applicable for
34
+ the relevant file selection options.
32
35
33
36
OPTIONS
34
37
-------
35
38
-c::
36
39
--cached::
37
- Show cached files in the output (default)
40
+ Show all files cached in Git's index, i.e. all tracked files.
41
+ (This is the default if no -c/-s/-d/-o/-u/-k/-m/--resolve-undo
42
+ options are specified.)
38
43
39
44
-d::
40
45
--deleted::
41
- Show deleted files in the output
46
+ Show files with an unstaged deletion
42
47
43
48
-m::
44
49
--modified::
45
- Show modified files in the output
50
+ Show files with an unstaged modification (note that an unstaged
51
+ deletion also counts as an unstaged modification)
46
52
47
53
-o::
48
54
--others::
49
55
Show other (i.e. untracked) files in the output
50
56
51
57
-i::
52
58
--ignored::
53
- Show only ignored files in the output. When showing files in the
54
- index, print only those matched by an exclude pattern. When
55
- showing "other" files, show only those matched by an exclude
56
- pattern. Standard ignore rules are not automatically activated,
57
- therefore at least one of the `--exclude*` options is required.
59
+ Show only ignored files in the output. Must be used with
60
+ either an explicit '-c' or '-o'. When showing files in the
61
+ index (i.e. when used with '-c'), print only those files
62
+ matching an exclude pattern. When showing "other" files
63
+ (i.e. when used with '-o'), show only those matched by an
64
+ exclude pattern. Standard ignore rules are not automatically
65
+ activated, therefore at least one of the `--exclude*` options
66
+ is required.
58
67
59
68
-s::
60
69
--stage::
@@ -63,19 +72,29 @@ OPTIONS
63
72
--directory::
64
73
If a whole directory is classified as "other", show just its
65
74
name (with a trailing slash) and not its whole contents.
75
+ Has no effect without -o/--others.
66
76
67
77
--no-empty-directory::
68
78
Do not list empty directories. Has no effect without --directory.
69
79
70
80
-u::
71
81
--unmerged::
72
- Show unmerged files in the output (forces --stage)
82
+ Show information about unmerged files in the output, but do
83
+ not show any other tracked files (forces --stage, overrides
84
+ --cached).
73
85
74
86
-k::
75
87
--killed::
76
- Show files on the filesystem that need to be removed due
77
- to file/directory conflicts for checkout-index to
78
- succeed.
88
+ Show untracked files on the filesystem that need to be removed
89
+ due to file/directory conflicts for tracked files to be able to
90
+ be written to the filesystem.
91
+
92
+ --resolve-undo::
93
+ Show files having resolve-undo information in the index
94
+ together with their resolve-undo information. (resolve-undo
95
+ information is what is used to implement "git checkout -m
96
+ $PATH", i.e. to recreate merge conflicts that were
97
+ accidentally resolved)
79
98
80
99
-z::
81
100
\0 line termination on output and do not quote filenames.
@@ -100,7 +119,8 @@ OPTIONS
100
119
101
120
--exclude-per-directory=<file>::
102
121
Read additional exclude patterns that apply only to the
103
- directory and its subdirectories in <file>.
122
+ directory and its subdirectories in <file>. Deprecated; use
123
+ --exclude-standard instead.
104
124
105
125
--exclude-standard::
106
126
Add the standard Git exclusions: .git/info/exclude, .gitignore
@@ -118,24 +138,27 @@ OPTIONS
118
138
with `-s` or `-u` options does not make any sense.
119
139
120
140
-t::
121
- This feature is semi-deprecated. For scripting purpose,
122
- linkgit:git-status[1] `--porcelain` and
141
+ Show status tags together with filenames. Note that for
142
+ scripting purposes, linkgit:git-status[1] `--porcelain` and
123
143
linkgit:git-diff-files[1] `--name-status` are almost always
124
144
superior alternatives, and users should look at
125
145
linkgit:git-status[1] `--short` or linkgit:git-diff[1]
126
146
`--name-status` for more user-friendly alternatives.
127
147
+
128
148
--
129
- This option identifies the file status with the following tags (followed by
130
- a space) at the start of each line:
131
-
132
- H:: cached
133
- S:: skip-worktree
134
- M:: unmerged
135
- R:: removed/deleted
136
- C:: modified/changed
137
- K:: to be killed
138
- ?:: other
149
+ This option provides a reason for showing each filename, in the form
150
+ of a status tag (which is followed by a space and then the filename).
151
+ The status tags are all single characters from the following list:
152
+
153
+ H:: tracked file that is not either unmerged or skip-worktree
154
+ S:: tracked file that is skip-worktree
155
+ M:: tracked file that is unmerged
156
+ R:: tracked file with unstaged removal/deletion
157
+ C:: tracked file with unstaged modification/change
158
+ K:: untracked paths which are part of file/directory conflicts
159
+ which prevent checking out tracked files
160
+ ?:: untracked file
161
+ U:: file with resolve-undo information
139
162
--
140
163
141
164
-v::
@@ -269,7 +292,9 @@ traversing the directory tree and finding files to show when the
269
292
flags --others or --ignored are specified. linkgit:gitignore[5]
270
293
specifies the format of exclude patterns.
271
294
272
- These exclude patterns come from these places, in order:
295
+ Generally, you should just use --exclude-standard, but for historical
296
+ reasons the exclude patterns can be specified from the following
297
+ places, in order:
273
298
274
299
1. The command-line flag --exclude=<pattern> specifies a
275
300
single pattern. Patterns are ordered in the same order
0 commit comments