3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.39.1.231.ga7caae2729
10 .TH "GIT\-STATUS" "1" "01/17/2023" "Git 2\&.39\&.1\&.231\&.ga7caae" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-status \- Show the working tree status
35 \fIgit status\fR [<options>] [\-\-] [<pathspec>\&...]
40 Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index file, and paths in the working tree that are not tracked by Git (and are not ignored by \fBgitignore\fR(5))\&. The first are what you \fIwould\fR commit by running \fBgit commit\fR; the second and third are what you \fIcould\fR commit by running \fIgit add\fR before running \fBgit commit\fR\&.
45 Give the output in the short\-format\&.
50 Show the branch and tracking info even in short\-format\&.
55 Show the number of entries currently stashed away\&.
58 \-\-porcelain[=<version>]
60 Give the output in an easy\-to\-parse format for scripts\&. This is similar to the short output, but will remain stable across Git versions and regardless of user configuration\&. See below for details\&.
62 The version parameter is used to specify the format version\&. This is optional and defaults to the original version
69 Give the output in the long\-format\&. This is the default\&.
74 In addition to the names of files that have been changed, also show the textual changes that are staged to be committed (i\&.e\&., like the output of
75 \fBgit diff \-\-cached\fR)\&. If
77 is specified twice, then also show the changes in the working tree that have not yet been staged (i\&.e\&., like the output of
81 \-u[<mode>], \-\-untracked\-files[=<mode>]
83 Show untracked files\&.
85 The mode parameter is used to specify the handling of untracked files\&. It is optional: it defaults to
86 \fIall\fR, and if specified, it must be stuck to the option (e\&.g\&.
90 The possible options are:
101 \- Show no untracked files\&.
113 \- Shows untracked files and directories\&.
125 \- Also shows individual files in untracked directories\&.
130 option is not used, untracked files and directories are shown (i\&.e\&. the same as specifying
131 \fBnormal\fR), to help you avoid forgetting to add newly created files\&. Because it takes extra work to find untracked files in the filesystem, this mode may take some time in a large working tree\&. Consider enabling untracked cache and split index if supported (see
132 \fBgit update\-index \-\-untracked\-cache\fR
134 \fBgit update\-index \-\-split\-index\fR), Otherwise you can use
138 return more quickly without showing untracked files\&.
140 The default can be changed using the status\&.showUntrackedFiles configuration variable documented in
141 \fBgit-config\fR(1)\&.
144 \-\-ignore\-submodules[=<when>]
146 Ignore changes to submodules when looking for changes\&. <when> can be either "none", "untracked", "dirty" or "all", which is the default\&. Using "none" will consider the submodule modified when it either contains untracked or modified files or its HEAD differs from the commit recorded in the superproject and can be used to override any settings of the
151 \fBgitmodules\fR(5)\&. When "untracked" is used submodules are not considered dirty when they only contain untracked content (but they are still scanned for modified content)\&. Using "dirty" ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown (this was the behavior before 1\&.7\&.0)\&. Using "all" hides all changes to submodules (and suppresses the output of submodule summaries when the config option
152 \fBstatus\&.submoduleSummary\fR
158 Show ignored files as well\&.
160 The mode parameter is used to specify the handling of ignored files\&. It is optional: it defaults to
163 The possible options are:
174 \- Shows ignored files and directories, unless \-\-untracked\-files=all is specified, in which case individual files in ignored directories are displayed\&.
186 \- Show no ignored files\&.
198 \- Shows ignored files and directories matching an ignore pattern\&.
203 mode is specified, paths that explicitly match an ignored pattern are shown\&. If a directory matches an ignore pattern, then it is shown, but not paths contained in the ignored directory\&. If a directory does not match an ignore pattern, but all contents are ignored, then the directory is not shown, but all contents are shown\&.
208 Terminate entries with NUL, instead of LF\&. This implies the
209 \fB\-\-porcelain=v1\fR
210 output format if no other format is given\&.
213 \-\-column[=<options>], \-\-no\-column
215 Display untracked files in columns\&. See configuration variable
216 \fBcolumn\&.status\fR
221 without options are equivalent to
228 \-\-ahead\-behind, \-\-no\-ahead\-behind
230 Display or do not display detailed ahead/behind counts for the branch relative to its upstream branch\&. Defaults to true\&.
233 \-\-renames, \-\-no\-renames
235 Turn on/off rename detection regardless of user configuration\&. See also
237 \fB\-\-no\-renames\fR\&.
240 \-\-find\-renames[=<n>]
242 Turn on rename detection, optionally setting the similarity threshold\&. See also
244 \fB\-\-find\-renames\fR\&.
252 \fBgitglossary\fR(7)\&.
256 The output from this command is designed to be used as a commit template comment\&. The default, long format, is designed to be human readable, verbose and descriptive\&. Its contents and format are subject to change at any time\&.
258 The paths mentioned in the output, unlike many other Git commands, are made relative to the current directory if you are working in a subdirectory (this is on purpose, to help cutting and pasting)\&. See the status\&.relativePaths config option below\&.
261 In the short\-format, the status of each path is shown as one of these forms
268 XY ORIG_PATH \-> PATH
274 where \fBORIG_PATH\fR is where the renamed/copied contents came from\&. \fBORIG_PATH\fR is only shown when the entry is renamed or copied\&. The \fBXY\fR is a two\-letter status code\&.
276 The fields (including the \fB\->\fR) are separated from each other by a single space\&. If a filename contains whitespace or other nonprintable characters, that field will be quoted in the manner of a C string literal: surrounded by ASCII double quote (34) characters, and with interior special characters backslash\-escaped\&.
278 There are three different types of states that are shown using this format, and each one uses the \fBXY\fR syntax differently:
288 When a merge is occurring and the merge was successful, or outside of a merge situation,
290 shows the status of the index and
292 shows the status of the working tree\&.
303 When a merge conflict has occurred and has not yet been resolved,
307 show the state introduced by each head of the merge, relative to the common ancestor\&. These paths are said to be
319 When a path is untracked,
323 are always the same, since they are unknown to the index\&.
325 is used for untracked paths\&. Ignored files are not listed unless
327 is used; if it is, ignored files are indicated by
331 Note that the term \fImerge\fR here also includes rebases using the default \fB\-\-merge\fR strategy, cherry\-picks, and anything else using the merge machinery\&.
333 In the following table, these three classes are shown in separate sections, and these characters are used for \fBX\fR and \fBY\fR fields for the first two sections that show tracked paths:
343 \(aq \(aq = unmodified
367 = file type changed (regular file, symbolic link or submodule)
415 = copied (if config option status\&.renames is set to "copies")
427 = updated but unmerged
435 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
437 M [ MTD] updated in index
438 T [ MTD] type changed in index
439 A [ MTD] added to index
441 R [ MTD] renamed in index
442 C [ MTD] copied in index
443 [MTARC] index and work tree matches
444 [ MTARC] M work tree changed since index
445 [ MTARC] T type changed in work tree since index
446 [ MTARC] D deleted in work tree
447 R renamed in work tree
448 C copied in work tree
449 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
450 D D unmerged, both deleted
451 A U unmerged, added by us
452 U D unmerged, deleted by them
453 U A unmerged, added by them
454 D U unmerged, deleted by us
455 A A unmerged, both added
456 U U unmerged, both modified
457 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
460 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
466 Submodules have more state and instead report M the submodule has a different HEAD than recorded in the index m the submodule has modified content ? the submodule has untracked files since modified content or untracked files in a submodule cannot be added via \fBgit add\fR in the superproject to prepare a commit\&.
468 \fIm\fR and \fI?\fR are applied recursively\&. For example if a nested submodule in a submodule contains an untracked file, this is reported as \fI?\fR as well\&.
470 If \-b is used the short\-format status is preceded by a line
476 ## branchname tracking info
481 .SS "Porcelain Format Version 1"
483 Version 1 porcelain format is similar to the short format, but is guaranteed not to change in a backwards\-incompatible way between Git versions or based on user configuration\&. This makes it ideal for parsing by scripts\&. The description of the short format above also describes the porcelain format, with a few exceptions:
493 The user\(cqs color\&.status configuration is not respected; color will always be off\&.
504 The user\(cqs status\&.relativePaths configuration is not respected; paths shown will always be relative to the repository root\&.
507 There is also an alternate \-z format recommended for machine parsing\&. In that format, the status field is the same, but some other things change\&. First, the \fI\->\fR is omitted from rename entries and the field order is reversed (e\&.g \fIfrom \-> to\fR becomes \fIto from\fR)\&. Second, a NUL (ASCII 0) follows each filename, replacing space as a field separator and the terminating newline (but a space still separates the status field from the first filename)\&. Third, filenames containing special characters are not specially formatted; no quoting or backslash\-escaping is performed\&.
509 Any submodule changes are reported as modified \fBM\fR instead of \fBm\fR or single \fB?\fR\&.
510 .SS "Porcelain Format Version 2"
512 Version 2 format adds more detailed information about the state of the worktree and changed items\&. Version 2 also defines an extensible set of easy to parse optional headers\&.
514 Header lines start with "#" and are added in response to specific command line arguments\&. Parsers should ignore headers they don\(cqt recognize\&.
517 .nr an-no-space-flag 1
524 If \fB\-\-branch\fR is given, a series of header lines are printed with information about the current branch\&.
531 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
532 # branch\&.oid <commit> | (initial) Current commit\&.
533 # branch\&.head <branch> | (detached) Current branch\&.
534 # branch\&.upstream <upstream_branch> If upstream is set\&.
535 # branch\&.ab +<ahead> \-<behind> If upstream is set and
536 the commit is present\&.
537 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
545 .nr an-no-space-flag 1
549 \fBStash Information\fR
552 If \fB\-\-show\-stash\fR is given, one line is printed showing the number of stash entries if non\-zero:
566 .nr an-no-space-flag 1
570 \fBChanged Tracked Entries\fR
573 Following the headers, a series of lines are printed for tracked entries\&. One of three different line formats may be used to describe an entry depending on the type of change\&. Tracked entries are printed in an undefined order; parsers should allow for a mixture of the 3 line types in any order\&.
575 Ordinary changed entries have the following format:
581 1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path>
587 Renamed or copied entries have the following format:
593 2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>
604 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
605 <XY> A 2 character field containing the staged and
606 unstaged XY values described in the short format,
607 with unchanged indicated by a "\&." rather than
609 <sub> A 4 character field describing the submodule state\&.
610 "N\&.\&.\&." when the entry is not a submodule\&.
611 "S<c><m><u>" when the entry is a submodule\&.
612 <c> is "C" if the commit changed; otherwise "\&."\&.
613 <m> is "M" if it has tracked changes; otherwise "\&."\&.
614 <u> is "U" if there are untracked changes; otherwise "\&."\&.
615 <mH> The octal file mode in HEAD\&.
616 <mI> The octal file mode in the index\&.
617 <mW> The octal file mode in the worktree\&.
618 <hH> The object name in HEAD\&.
619 <hI> The object name in the index\&.
620 <X><score> The rename or copy score (denoting the percentage
621 of similarity between the source and target of the
622 move or copy)\&. For example "R100" or "C75"\&.
623 <path> The pathname\&. In a renamed/copied entry, this
624 is the target path\&.
625 <sep> When the `\-z` option is used, the 2 pathnames are separated
626 with a NUL (ASCII 0x00) byte; otherwise, a tab (ASCII 0x09)
627 byte separates them\&.
628 <origPath> The pathname in the commit at HEAD or in the index\&.
629 This is only present in a renamed/copied entry, and
630 tells where the renamed/copied contents came from\&.
631 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
637 Unmerged entries have the following format; the first character is a "u" to distinguish from ordinary changed entries\&.
643 u <XY> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path>
654 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
655 <XY> A 2 character field describing the conflict type
656 as described in the short format\&.
657 <sub> A 4 character field describing the submodule state
658 as described above\&.
659 <m1> The octal file mode in stage 1\&.
660 <m2> The octal file mode in stage 2\&.
661 <m3> The octal file mode in stage 3\&.
662 <mW> The octal file mode in the worktree\&.
663 <h1> The object name in stage 1\&.
664 <h2> The object name in stage 2\&.
665 <h3> The object name in stage 3\&.
666 <path> The pathname\&.
667 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
675 .nr an-no-space-flag 1
682 Following the tracked entries (and if requested), a series of lines will be printed for untracked and then ignored items found in the worktree\&.
684 Untracked items have the following format:
696 Ignored items have the following format:
710 .nr an-no-space-flag 1
714 \fBPathname Format Notes and -z\fR
717 When the \fB\-z\fR option is given, pathnames are printed as is and without any quoting and lines are terminated with a NUL (ASCII 0x00) byte\&.
719 Without the \fB\-z\fR option, pathnames with "unusual" characters are quoted as explained for the configuration variable \fBcore\&.quotePath\fR (see \fBgit-config\fR(1))\&.
723 The command honors \fBcolor\&.status\fR (or \fBstatus\&.color\fR \(em they mean the same thing and the latter is kept for backward compatibility) and \fBcolor\&.status\&.<slot>\fR configuration variables to colorize its output\&.
725 If the config variable \fBstatus\&.relativePaths\fR is set to false, then all paths shown are relative to the repository root, not to the current directory\&.
727 If \fBstatus\&.submoduleSummary\fR is set to a non zero number or true (identical to \-1 or an unlimited number), the submodule summary will be enabled for the long format and a summary of commits for modified submodules will be shown (see \-\-summary\-limit option of \fBgit-submodule\fR(1))\&. Please note that the summary output from the status command will be suppressed for all submodules when \fBdiff\&.ignoreSubmodules\fR is set to \fIall\fR or only for those submodules where \fBsubmodule\&.<name>\&.ignore=all\fR\&. To also view the summary for ignored submodules you can either use the \-\-ignore\-submodules=dirty command line option or the \fIgit submodule summary\fR command, which shows a similar output but does not honor these settings\&.
728 .SH "BACKGROUND REFRESH"
730 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)\&.
731 .SH "UNTRACKED FILES AND PERFORMANCE"
733 \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\&.
744 \fB\-\-untracked\-files=no\fR
746 \fBstatus\&.showUntrackedfiles=false\fR
747 config (see above for both): indicate that
749 should not report untracked files\&. This is the fastest option\&.
751 will not list the untracked files, so you need to be careful to remember if you create any new files and manually
764 \fBadvice\&.statusUoption=false\fR
766 \fBgit-config\fR(1)): setting this variable to
768 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\&.
779 \fBcore\&.untrackedCache=true\fR
781 \fBgit-update-index\fR(1)): enable the untracked cache feature and only search directories that have been modified since the previous
783 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
785 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\&.
796 \fBcore\&.untrackedCache=true\fR
798 \fBcore\&.fsmonitor=true\fR
800 \fBcore\&.fsmonitor=<hook_command_pathname>\fR
802 \fBgit-update-index\fR(1)): enable both the untracked cache and FSMonitor features and only search directories that have been modified since the previous
804 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\&.
807 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\&.
813 Part of the \fBgit\fR(1) suite