summaryrefslogtreecommitdiffstats
path: root/man1/git-status.1
diff options
context:
space:
mode:
Diffstat (limited to 'man1/git-status.1')
-rw-r--r--man1/git-status.183
1 files changed, 80 insertions, 3 deletions
diff --git a/man1/git-status.1 b/man1/git-status.1
index 9e36985df..953111103 100644
--- a/man1/git-status.1
+++ b/man1/git-status.1
@@ -2,12 +2,12 @@
.\" Title: git-status
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\" Date: 12/14/2022
+.\" Date: 12/19/2022
.\" Manual: Git Manual
-.\" Source: Git 2.39.0.56.g57e2c6ebbe
+.\" Source: Git 2.39.0.95.g7c2ef319c5
.\" Language: English
.\"
-.TH "GIT\-STATUS" "1" "12/14/2022" "Git 2\&.39\&.0\&.56\&.g57e2c6e" "Git Manual"
+.TH "GIT\-STATUS" "1" "12/19/2022" "Git 2\&.39\&.0\&.95\&.g7c2ef31" "Git Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -728,6 +728,83 @@ If \fBstatus\&.submoduleSummary\fR is set to a non zero number or true (identica
.SH "BACKGROUND REFRESH"
.sp
By default, \fBgit status\fR will automatically refresh the index, updating the cached stat information from the working tree and writing out the result\&. Writing out the updated index is an optimization that isn\(cqt strictly necessary (\fBstatus\fR computes the values for itself, but writing them out is just to save subsequent programs from repeating our computation)\&. When \fBstatus\fR is run in the background, the lock held during the write may conflict with other simultaneous processes, causing them to fail\&. Scripts running \fBstatus\fR in the background should consider using \fBgit \-\-no\-optional\-locks status\fR (see \fBgit\fR(1) for details)\&.
+.SH "UNTRACKED FILES AND PERFORMANCE"
+.sp
+\fBgit status\fR can be very slow in large worktrees if/when it needs to search for untracked files and directories\&. There are many configuration options available to speed this up by either avoiding the work or making use of cached results from previous Git commands\&. There is no single optimum set of settings right for everyone\&. We\(cqll list a summary of the relevant options to help you, but before going into the list, you may want to run \fBgit status\fR again, because your configuration may already be caching \fBgit status\fR results, so it could be faster on subsequent runs\&.
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+The
+\fB\-\-untracked\-files=no\fR
+flag or the
+\fBstatus\&.showUntrackedfiles=false\fR
+config (see above for both): indicate that
+\fBgit status\fR
+should not report untracked files\&. This is the fastest option\&.
+\fBgit status\fR
+will not list the untracked files, so you need to be careful to remember if you create any new files and manually
+\fBgit add\fR
+them\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fBadvice\&.statusUoption=false\fR
+(see
+\fBgit-config\fR(1)): setting this variable to
+\fBfalse\fR
+disables the warning message given when enumerating untracked files takes more than 2 seconds\&. In a large project, it may take longer and the user may have already accepted the trade off (e\&.g\&. using "\-uno" may not be an acceptable option for the user), in which case, there is no point issuing the warning message, and in such a case, disabling the warning may be the best\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fBcore\&.untrackedCache=true\fR
+(see
+\fBgit-update-index\fR(1)): enable the untracked cache feature and only search directories that have been modified since the previous
+\fBgit status\fR
+command\&. Git remembers the set of untracked files within each directory and assumes that if a directory has not been modified, then the set of untracked files within has not changed\&. This is much faster than enumerating the contents of every directory, but still not without cost, because Git still has to search for the set of modified directories\&. The untracked cache is stored in the
+\fB\&.git/index\fR
+file\&. The reduced cost of searching for untracked files is offset slightly by the increased size of the index and the cost of keeping it up\-to\-date\&. That reduced search time is usually worth the additional size\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+\fBcore\&.untrackedCache=true\fR
+and
+\fBcore\&.fsmonitor=true\fR
+or
+\fBcore\&.fsmonitor=<hook_command_pathname>\fR
+(see
+\fBgit-update-index\fR(1)): enable both the untracked cache and FSMonitor features and only search directories that have been modified since the previous
+\fBgit status\fR
+command\&. This is faster than using just the untracked cache alone because Git can also avoid searching for modified directories\&. Git only has to enumerate the exact set of directories that have changed recently\&. While the FSMonitor feature can be enabled without the untracked cache, the benefits are greatly reduced in that case\&.
+.RE
+.sp
+Note that after you turn on the untracked cache and/or FSMonitor features it may take a few \fBgit status\fR commands for the various caches to warm up before you see improved command times\&. This is normal\&.
.SH "SEE ALSO"
.sp
\fBgitignore\fR(5)