blob: a051b1e8f383abc618397ea7e2ac2f173d30a111 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-status(1)
2=============
3
4NAME
5----
Junio C Hamano7c73c662007-01-19 00:37:506git-status - Show the working tree status
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamano15567bc2011-07-23 00:51:5911[verse]
Junio C Hamanocf9c7732022-10-28 18:56:0612'git status' [<options>] [--] [<pathspec>...]
Junio C Hamano1a4e8412005-12-27 08:17:2313
14DESCRIPTION
15-----------
Junio C Hamano942b35e2007-12-09 10:19:3316Displays paths that have differences between the index file and the
17current HEAD commit, paths that have differences between the working
18tree and the index file, and paths in the working tree that are not
Junio C Hamano076ffcc2013-02-06 05:13:2119tracked by Git (and are not ignored by linkgit:gitignore[5]). The first
Junio C Hamano942b35e2007-12-09 10:19:3320are what you _would_ commit by running `git commit`; the second and
Junio C Hamano1aa40d22010-01-21 17:46:4321third are what you _could_ commit by running 'git add' before running
Junio C Hamano942b35e2007-12-09 10:19:3322`git commit`.
Junio C Hamano1a4e8412005-12-27 08:17:2323
Junio C Hamanoa0fae262009-12-28 09:33:5024OPTIONS
25-------
Junio C Hamano8fd52302006-08-10 00:18:0826
Junio C Hamanoa0fae262009-12-28 09:33:5027-s::
28--short::
29Give the output in the short-format.
30
Junio C Hamanof5de4cf2010-06-19 00:33:1731-b::
32--branch::
33Show the branch and tracking info even in short-format.
34
Junio C Hamano967cda72017-06-30 21:49:5335--show-stash::
36Show the number of entries currently stashed away.
37
Junio C Hamanocd451662016-09-13 00:54:0938--porcelain[=<version>]::
Junio C Hamanoef5a2f92011-05-31 19:53:3339Give the output in an easy-to-parse format for scripts.
40This is similar to the short output, but will remain stable
Junio C Hamano076ffcc2013-02-06 05:13:2141across Git versions and regardless of user configuration. See
Junio C Hamanoef5a2f92011-05-31 19:53:3342below for details.
Junio C Hamanocd451662016-09-13 00:54:0943+
44The version parameter is used to specify the format version.
45This is optional and defaults to the original version 'v1' format.
Junio C Hamanoa0fae262009-12-28 09:33:5046
Junio C Hamanoa1295452012-11-13 22:32:0447--long::
48Give the output in the long-format. This is the default.
49
Junio C Hamano8152abf2015-04-28 22:48:0250-v::
51--verbose::
52In addition to the names of files that have been changed, also
53show the textual changes that are staged to be committed
54(i.e., like the output of `git diff --cached`). If `-v` is specified
55twice, then also show the changes in the working tree that
56have not yet been staged (i.e., like the output of `git diff`).
57
Junio C Hamanoa0fae262009-12-28 09:33:5058-u[<mode>]::
59--untracked-files[=<mode>]::
Junio C Hamano36a4dbc2011-02-22 07:51:3260Show untracked files.
Junio C Hamanoa0fae262009-12-28 09:33:5061+
Junio C Hamano48cd3f12019-10-09 05:55:3062--
Junio C Hamano1eb56092015-10-05 20:39:5363The mode parameter is used to specify the handling of untracked files.
64It is optional: it defaults to 'all', and if specified, it must be
65stuck to the option (e.g. `-uno`, but not `-u no`).
Junio C Hamano48cd3f12019-10-09 05:55:3066
Junio C Hamano36a4dbc2011-02-22 07:51:3267The possible options are:
Junio C Hamano48cd3f12019-10-09 05:55:3068
Junio C Hamano5e7f1312013-03-21 22:49:0169- 'no' - Show no untracked files.
70- 'normal' - Shows untracked files and directories.
Junio C Hamanoa0fae262009-12-28 09:33:5071- 'all' - Also shows individual files in untracked directories.
Junio C Hamano48cd3f12019-10-09 05:55:3072
Junio C Hamano5e7f1312013-03-21 22:49:0173When `-u` option is not used, untracked files and directories are
74shown (i.e. the same as specifying `normal`), to help you avoid
75forgetting to add newly created files. Because it takes extra work
76to find untracked files in the filesystem, this mode may take some
Junio C Hamanoc4e2a202015-05-26 21:38:4777time in a large working tree.
78Consider enabling untracked cache and split index if supported (see
79`git update-index --untracked-cache` and `git update-index
80--split-index`), Otherwise you can use `no` to have `git status`
Junio C Hamano5e7f1312013-03-21 22:49:0181return more quickly without showing untracked files.
Junio C Hamano48cd3f12019-10-09 05:55:3082
Junio C Hamano36a4dbc2011-02-22 07:51:3283The default can be changed using the status.showUntrackedFiles
84configuration variable documented in linkgit:git-config[1].
Junio C Hamano48cd3f12019-10-09 05:55:3085--
Junio C Hamanoa0fae262009-12-28 09:33:5086
Junio C Hamano7d449522010-07-01 00:08:5187--ignore-submodules[=<when>]::
88Ignore changes to submodules when looking for changes. <when> can be
Junio C Hamano619596a2010-08-18 22:15:3589either "none", "untracked", "dirty" or "all", which is the default.
90Using "none" will consider the submodule modified when it either contains
91untracked or modified files or its HEAD differs from the commit recorded
92in the superproject and can be used to override any settings of the
93'ignore' option in linkgit:git-config[1] or linkgit:gitmodules[5]. When
Junio C Hamano7d449522010-07-01 00:08:5194"untracked" is used submodules are not considered dirty when they only
95contain untracked content (but they are still scanned for modified
96content). Using "dirty" ignores all changes to the work tree of submodules,
97only changes to the commits stored in the superproject are shown (this was
98the behavior before 1.7.0). Using "all" hides all changes to submodules
99(and suppresses the output of submodule summaries when the config option
Junio C Hamano322c6242015-03-23 21:32:46100`status.submoduleSummary` is set).
Junio C Hamano7d449522010-07-01 00:08:51101
Junio C Hamanob72f6032017-11-15 05:57:08102--ignored[=<mode>]::
Junio C Hamano4c4b0122011-06-30 01:19:32103Show ignored files as well.
Junio C Hamanob72f6032017-11-15 05:57:08104+
Junio C Hamano48cd3f12019-10-09 05:55:30105--
Junio C Hamanob72f6032017-11-15 05:57:08106The mode parameter is used to specify the handling of ignored files.
107It is optional: it defaults to 'traditional'.
Junio C Hamano48cd3f12019-10-09 05:55:30108
Junio C Hamanob72f6032017-11-15 05:57:08109The possible options are:
Junio C Hamano48cd3f12019-10-09 05:55:30110
Junio C Hamanob72f6032017-11-15 05:57:08111- 'traditional' - Shows ignored files and directories, unless
Junio C Hamanoea1ac8d2018-07-18 20:16:48112 --untracked-files=all is specified, in which case
Junio C Hamanob72f6032017-11-15 05:57:08113 individual files in ignored directories are
114 displayed.
115- 'no' - Show no ignored files.
116- 'matching' - Shows ignored files and directories matching an
117 ignore pattern.
Junio C Hamano48cd3f12019-10-09 05:55:30118
Junio C Hamano96153bf2018-04-25 08:25:34119When 'matching' mode is specified, paths that explicitly match an
Junio C Hamanob72f6032017-11-15 05:57:08120ignored pattern are shown. If a directory matches an ignore pattern,
121then it is shown, but not paths contained in the ignored directory. If
122a directory does not match an ignore pattern, but all contents are
123ignored, then the directory is not shown, but all contents are shown.
Junio C Hamano48cd3f12019-10-09 05:55:30124--
Junio C Hamano4c4b0122011-06-30 01:19:32125
Junio C Hamanoa0fae262009-12-28 09:33:50126-z::
127Terminate entries with NUL, instead of LF. This implies
Junio C Hamanocd451662016-09-13 00:54:09128the `--porcelain=v1` output format if no other format is given.
Junio C Hamano942b35e2007-12-09 10:19:33129
Junio C Hamano22700fb2012-05-03 23:07:25130--column[=<options>]::
131--no-column::
132Display untracked files in columns. See configuration variable
Junio C Hamanoa372d5b2021-02-26 01:34:37133`column.status` for option syntax. `--column` and `--no-column`
Junio C Hamano22700fb2012-05-03 23:07:25134without options are equivalent to 'always' and 'never'
135respectively.
136
Junio C Hamanoa25ccc42018-03-08 21:36:14137--ahead-behind::
138--no-ahead-behind::
139Display or do not display detailed ahead/behind counts for the
140branch relative to its upstream branch. Defaults to true.
141
Junio C Hamano309465b2018-05-30 06:32:59142--renames::
143--no-renames::
144Turn on/off rename detection regardless of user configuration.
145See also linkgit:git-diff[1] `--no-renames`.
146
147--find-renames[=<n>]::
148Turn on rename detection, optionally setting the similarity
149threshold.
150See also linkgit:git-diff[1] `--find-renames`.
151
Junio C Hamano139b7d12017-10-03 07:10:59152<pathspec>...::
153See the 'pathspec' entry in linkgit:gitglossary[7].
Junio C Hamano1a4e8412005-12-27 08:17:23154
155OUTPUT
156------
157The output from this command is designed to be used as a commit
Junio C Hamano52b6ba32014-04-01 00:26:48158template comment.
Junio C Hamanoa0fae262009-12-28 09:33:50159The default, long format, is designed to be human readable,
Junio C Hamanoef5a2f92011-05-31 19:53:33160verbose and descriptive. Its contents and format are subject to change
161at any time.
Junio C Hamano1a4e8412005-12-27 08:17:23162
Junio C Hamano076ffcc2013-02-06 05:13:21163The paths mentioned in the output, unlike many other Git commands, are
Junio C Hamano942b35e2007-12-09 10:19:33164made relative to the current directory if you are working in a
165subdirectory (this is on purpose, to help cutting and pasting). See
166the status.relativePaths config option below.
Junio C Hamano00b8b632007-12-07 09:50:49167
Junio C Hamanoef5a2f92011-05-31 19:53:33168Short Format
169~~~~~~~~~~~~
170
Junio C Hamano7b9cce92018-01-23 22:34:27171In the short-format, the status of each path is shown as one of these
172forms
Junio C Hamanoa0fae262009-12-28 09:33:50173
Junio C Hamano7b9cce92018-01-23 22:34:27174XY PATH
175XY ORIG_PATH -> PATH
Junio C Hamanoa0fae262009-12-28 09:33:50176
Junio C Hamano7b9cce92018-01-23 22:34:27177where `ORIG_PATH` is where the renamed/copied contents came
178from. `ORIG_PATH` is only shown when the entry is renamed or
179copied. The `XY` is a two-letter status code.
Junio C Hamanoa0fae262009-12-28 09:33:50180
Junio C Hamanob76a6862012-05-02 22:02:46181The fields (including the `->`) are separated from each other by a
Junio C Hamanofc5d7352010-04-24 02:59:11182single space. If a filename contains whitespace or other nonprintable
183characters, that field will be quoted in the manner of a C string
184literal: surrounded by ASCII double quote (34) characters, and with
185interior special characters backslash-escaped.
Junio C Hamanoa0fae262009-12-28 09:33:50186
Junio C Hamano7887f9b2021-01-25 23:32:33187There are three different types of states that are shown using this format, and
188each one uses the `XY` syntax differently:
189
190* When a merge is occurring and the merge was successful, or outside of a merge
191situation, `X` shows the status of the index and `Y` shows the status of the
192working tree.
193* When a merge conflict has occurred and has not yet been resolved, `X` and `Y`
194show the state introduced by each head of the merge, relative to the common
195ancestor. These paths are said to be _unmerged_.
196* When a path is untracked, `X` and `Y` are always the same, since they are
197unknown to the index. `??` is used for untracked paths. Ignored files are
198not listed unless `--ignored` is used; if it is, ignored files are indicated
199by `!!`.
200
201Note that the term _merge_ here also includes rebases using the default
202`--merge` strategy, cherry-picks, and anything else using the merge machinery.
203
204In the following table, these three classes are shown in separate sections, and
205these characters are used for `X` and `Y` fields for the first two sections that
206show tracked paths:
Junio C Hamanofc5d7352010-04-24 02:59:11207
208* ' ' = unmodified
209* 'M' = modified
Junio C Hamano7b1585b2021-10-14 17:11:58210* 'T' = file type changed (regular file, symbolic link or submodule)
Junio C Hamanofc5d7352010-04-24 02:59:11211* 'A' = added
212* 'D' = deleted
213* 'R' = renamed
Junio C Hamano7b1585b2021-10-14 17:11:58214* 'C' = copied (if config option status.renames is set to "copies")
Junio C Hamanofc5d7352010-04-24 02:59:11215* 'U' = updated but unmerged
216
Junio C Hamanoace33e42019-01-18 23:16:05217....
218X Y Meaning
219-------------------------------------------------
220 [AMD] not updated
Junio C Hamano7b1585b2021-10-14 17:11:58221M [ MTD] updated in index
222T [ MTD] type changed in index
223A [ MTD] added to index
Junio C Hamanoace33e42019-01-18 23:16:05224D deleted from index
Junio C Hamano7b1585b2021-10-14 17:11:58225R [ MTD] renamed in index
226C [ MTD] copied in index
227[MTARC] index and work tree matches
228[ MTARC] M work tree changed since index
229[ MTARC] T type changed in work tree since index
230[ MTARC] D deleted in work tree
231 R renamed in work tree
232 C copied in work tree
Junio C Hamanoace33e42019-01-18 23:16:05233-------------------------------------------------
234D D unmerged, both deleted
235A U unmerged, added by us
236U D unmerged, deleted by them
237U A unmerged, added by them
238D U unmerged, deleted by us
239A A unmerged, both added
240U U unmerged, both modified
241-------------------------------------------------
242? ? untracked
243! ! ignored
244-------------------------------------------------
245....
Junio C Hamanoa0fae262009-12-28 09:33:50246
Junio C Hamano52a094d2017-04-20 05:35:10247Submodules have more state and instead report
248M the submodule has a different HEAD than
249 recorded in the index
250m the submodule has modified content
251? the submodule has untracked files
252since modified content or untracked files in a submodule cannot be added
253via `git add` in the superproject to prepare a commit.
254
255'm' and '?' are applied recursively. For example if a nested submodule
256in a submodule contains an untracked file, this is reported as '?' as well.
257
Junio C Hamanof5de4cf2010-06-19 00:33:17258If -b is used the short-format status is preceded by a line
259
Junio C Hamanocd451662016-09-13 00:54:09260 ## branchname tracking info
Junio C Hamanof5de4cf2010-06-19 00:33:17261
Junio C Hamanocd451662016-09-13 00:54:09262Porcelain Format Version 1
263~~~~~~~~~~~~~~~~~~~~~~~~~~
Junio C Hamanoef5a2f92011-05-31 19:53:33264
Junio C Hamanocd451662016-09-13 00:54:09265Version 1 porcelain format is similar to the short format, but is guaranteed
Junio C Hamano076ffcc2013-02-06 05:13:21266not to change in a backwards-incompatible way between Git versions or
Junio C Hamanoef5a2f92011-05-31 19:53:33267based on user configuration. This makes it ideal for parsing by scripts.
268The description of the short format above also describes the porcelain
269format, with a few exceptions:
270
2711. The user's color.status configuration is not respected; color will
272 always be off.
273
2742. The user's status.relativePaths configuration is not respected; paths
275 shown will always be relative to the repository root.
276
277There is also an alternate -z format recommended for machine parsing. In
Junio C Hamanofc5d7352010-04-24 02:59:11278that format, the status field is the same, but some other things
Junio C Hamanoef5a2f92011-05-31 19:53:33279change. First, the '\->' is omitted from rename entries and the field
280order is reversed (e.g 'from \-> to' becomes 'to from'). Second, a NUL
Junio C Hamanofc5d7352010-04-24 02:59:11281(ASCII 0) follows each filename, replacing space as a field separator
282and the terminating newline (but a space still separates the status
283field from the first filename). Third, filenames containing special
284characters are not specially formatted; no quoting or
Junio C Hamanobcdb12e2012-05-10 18:45:15285backslash-escaping is performed.
Junio C Hamano1a4e8412005-12-27 08:17:23286
Junio C Hamano52a094d2017-04-20 05:35:10287Any submodule changes are reported as modified `M` instead of `m` or single `?`.
288
Junio C Hamanocd451662016-09-13 00:54:09289Porcelain Format Version 2
290~~~~~~~~~~~~~~~~~~~~~~~~~~
291
292Version 2 format adds more detailed information about the state of
293the worktree and changed items. Version 2 also defines an extensible
294set of easy to parse optional headers.
295
296Header lines start with "#" and are added in response to specific
297command line arguments. Parsers should ignore headers they
298don't recognize.
299
Junio C Hamanob5513772019-04-22 03:38:39300Branch Headers
301^^^^^^^^^^^^^^
Junio C Hamanocd451662016-09-13 00:54:09302
303If `--branch` is given, a series of header lines are printed with
304information about the current branch.
305
Junio C Hamanoace33e42019-01-18 23:16:05306....
307Line Notes
308------------------------------------------------------------
309# branch.oid <commit> | (initial) Current commit.
310# branch.head <branch> | (detached) Current branch.
311# branch.upstream <upstream_branch> If upstream is set.
312# branch.ab +<ahead> -<behind> If upstream is set and
313 the commit is present.
314------------------------------------------------------------
315....
Junio C Hamanocd451662016-09-13 00:54:09316
Junio C Hamanof24d6b52021-11-29 23:56:22317Stash Information
318^^^^^^^^^^^^^^^^^
319
320If `--show-stash` is given, one line is printed showing the number of stash
321entries if non-zero:
322
323 # stash <N>
324
Junio C Hamanob5513772019-04-22 03:38:39325Changed Tracked Entries
326^^^^^^^^^^^^^^^^^^^^^^^
Junio C Hamanocd451662016-09-13 00:54:09327
328Following the headers, a series of lines are printed for tracked
329entries. One of three different line formats may be used to describe
330an entry depending on the type of change. Tracked entries are printed
331in an undefined order; parsers should allow for a mixture of the 3
332line types in any order.
333
334Ordinary changed entries have the following format:
335
336 1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path>
337
338Renamed or copied entries have the following format:
339
340 2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>
341
Junio C Hamanoace33e42019-01-18 23:16:05342....
343Field Meaning
344--------------------------------------------------------
345<XY> A 2 character field containing the staged and
346 unstaged XY values described in the short format,
347 with unchanged indicated by a "." rather than
348 a space.
349<sub> A 4 character field describing the submodule state.
350 "N..." when the entry is not a submodule.
351 "S<c><m><u>" when the entry is a submodule.
352 <c> is "C" if the commit changed; otherwise ".".
353 <m> is "M" if it has tracked changes; otherwise ".".
354 <u> is "U" if there are untracked changes; otherwise ".".
355<mH> The octal file mode in HEAD.
356<mI> The octal file mode in the index.
357<mW> The octal file mode in the worktree.
358<hH> The object name in HEAD.
359<hI> The object name in the index.
360<X><score> The rename or copy score (denoting the percentage
361 of similarity between the source and target of the
362 move or copy). For example "R100" or "C75".
363<path> The pathname. In a renamed/copied entry, this
364 is the target path.
365<sep> When the `-z` option is used, the 2 pathnames are separated
366 with a NUL (ASCII 0x00) byte; otherwise, a tab (ASCII 0x09)
367 byte separates them.
368<origPath> The pathname in the commit at HEAD or in the index.
369 This is only present in a renamed/copied entry, and
370 tells where the renamed/copied contents came from.
371--------------------------------------------------------
372....
Junio C Hamanocd451662016-09-13 00:54:09373
374Unmerged entries have the following format; the first character is
375a "u" to distinguish from ordinary changed entries.
376
Junio C Hamano05971eb2021-10-06 21:18:33377 u <XY> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path>
Junio C Hamanocd451662016-09-13 00:54:09378
Junio C Hamanoace33e42019-01-18 23:16:05379....
380Field Meaning
381--------------------------------------------------------
382<XY> A 2 character field describing the conflict type
383 as described in the short format.
384<sub> A 4 character field describing the submodule state
385 as described above.
386<m1> The octal file mode in stage 1.
387<m2> The octal file mode in stage 2.
388<m3> The octal file mode in stage 3.
389<mW> The octal file mode in the worktree.
390<h1> The object name in stage 1.
391<h2> The object name in stage 2.
392<h3> The object name in stage 3.
393<path> The pathname.
394--------------------------------------------------------
395....
Junio C Hamanocd451662016-09-13 00:54:09396
Junio C Hamanob5513772019-04-22 03:38:39397Other Items
398^^^^^^^^^^^
Junio C Hamanocd451662016-09-13 00:54:09399
400Following the tracked entries (and if requested), a series of
401lines will be printed for untracked and then ignored items
402found in the worktree.
403
404Untracked items have the following format:
405
406 ? <path>
407
408Ignored items have the following format:
409
410 ! <path>
411
Junio C Hamanob5513772019-04-22 03:38:39412Pathname Format Notes and -z
413^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Junio C Hamanocd451662016-09-13 00:54:09414
415When the `-z` option is given, pathnames are printed as is and
416without any quoting and lines are terminated with a NUL (ASCII 0x00)
417byte.
418
Junio C Hamano0f6f3bf2017-03-13 07:01:53419Without the `-z` option, pathnames with "unusual" characters are
420quoted as explained for the configuration variable `core.quotePath`
421(see linkgit:git-config[1]).
Junio C Hamanocd451662016-09-13 00:54:09422
423
Junio C Hamanof9771f62007-01-17 17:42:30424CONFIGURATION
425-------------
426
427The command honors `color.status` (or `status.color` -- they
428mean the same thing and the latter is kept for backward
429compatibility) and `color.status.<slot>` configuration variables
430to colorize its output.
431
Junio C Hamano942b35e2007-12-09 10:19:33432If the config variable `status.relativePaths` is set to false, then all
433paths shown are relative to the repository root, not to the current
434directory.
435
Junio C Hamano322c6242015-03-23 21:32:46436If `status.submoduleSummary` is set to a non zero number or true (identical
Junio C Hamanoa0fae262009-12-28 09:33:50437to -1 or an unlimited number), the submodule summary will be enabled for
438the long format and a summary of commits for modified submodules will be
Junio C Hamano369e3402013-10-15 18:40:25439shown (see --summary-limit option of linkgit:git-submodule[1]). Please note
440that the summary output from the status command will be suppressed for all
441submodules when `diff.ignoreSubmodules` is set to 'all' or only for those
442submodules where `submodule.<name>.ignore=all`. To also view the summary for
443ignored submodules you can either use the --ignore-submodules=dirty command
444line option or the 'git submodule summary' command, which shows a similar
445output but does not honor these settings.
Junio C Hamanoe3ddb5b2008-04-21 00:48:07446
Junio C Hamano371470a2017-12-13 22:26:40447BACKGROUND REFRESH
448------------------
449
450By default, `git status` will automatically refresh the index, updating
451the cached stat information from the working tree and writing out the
452result. Writing out the updated index is an optimization that isn't
453strictly necessary (`status` computes the values for itself, but writing
454them out is just to save subsequent programs from repeating our
455computation). When `status` is run in the background, the lock held
456during the write may conflict with other simultaneous processes, causing
457them to fail. Scripts running `status` in the background should consider
458using `git --no-optional-locks status` (see linkgit:git[1] for details).
459
Junio C Hamano18ecbd02022-12-19 03:05:19460UNTRACKED FILES AND PERFORMANCE
461-------------------------------
462
463`git status` can be very slow in large worktrees if/when it
464needs to search for untracked files and directories. There are
465many configuration options available to speed this up by either
466avoiding the work or making use of cached results from previous
467Git commands. There is no single optimum set of settings right
468for everyone. We'll list a summary of the relevant options to help
469you, but before going into the list, you may want to run `git status`
470again, because your configuration may already be caching `git status`
471results, so it could be faster on subsequent runs.
472
473* The `--untracked-files=no` flag or the
474`status.showUntrackedfiles=false` config (see above for both):
475indicate that `git status` should not report untracked
476files. This is the fastest option. `git status` will not list
477the untracked files, so you need to be careful to remember if
478you create any new files and manually `git add` them.
479
480* `advice.statusUoption=false` (see linkgit:git-config[1]):
481setting this variable to `false` disables the warning message
482given when enumerating untracked files takes more than 2
483seconds. In a large project, it may take longer and the user
484may have already accepted the trade off (e.g. using "-uno" may
485not be an acceptable option for the user), in which case, there
486is no point issuing the warning message, and in such a case,
487disabling the warning may be the best.
488
489* `core.untrackedCache=true` (see linkgit:git-update-index[1]):
490enable the untracked cache feature and only search directories
491that have been modified since the previous `git status` command.
492Git remembers the set of untracked files within each directory
493and assumes that if a directory has not been modified, then
494the set of untracked files within has not changed. This is much
495faster than enumerating the contents of every directory, but still
496not without cost, because Git still has to search for the set of
497modified directories. The untracked cache is stored in the
498`.git/index` file. The reduced cost of searching for untracked
499files is offset slightly by the increased size of the index and
500the cost of keeping it up-to-date. That reduced search time is
501usually worth the additional size.
502
503* `core.untrackedCache=true` and `core.fsmonitor=true` or
504`core.fsmonitor=<hook_command_pathname>` (see
505linkgit:git-update-index[1]): enable both the untracked cache
506and FSMonitor features and only search directories that have
507been modified since the previous `git status` command. This
508is faster than using just the untracked cache alone because
509Git can also avoid searching for modified directories. Git
510only has to enumerate the exact set of directories that have
511changed recently. While the FSMonitor feature can be enabled
512without the untracked cache, the benefits are greatly reduced
513in that case.
514
515Note that after you turn on the untracked cache and/or FSMonitor
516features it may take a few `git status` commands for the various
517caches to warm up before you see improved command times. This is
518normal.
519
Junio C Hamano9049d912008-05-29 02:09:50520SEE ALSO
Junio C Hamano679d22d2007-06-02 21:13:44521--------
Junio C Hamano35738e82008-01-07 07:55:46522linkgit:gitignore[5]
Junio C Hamanof9771f62007-01-17 17:42:30523
Junio C Hamano1a4e8412005-12-27 08:17:23524GIT
525---
Junio C Hamanof7c042d2008-06-06 22:50:53526Part of the linkgit:git[1] suite