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.44.0.568.g436d4e5b14
10 .TH "GIT\-STATUS" "1" "2024\-04\-10" "Git 2\&.44\&.0\&.568\&.g436d4e" "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\&. All usual spellings for Boolean value
147 The default can be changed using the status\&.showUntrackedFiles configuration variable documented in
148 \fBgit-config\fR(1)\&.
151 \-\-ignore\-submodules[=<when>]
153 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
158 \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
159 \fBstatus\&.submoduleSummary\fR
165 Show ignored files as well\&.
167 The mode parameter is used to specify the handling of ignored files\&. It is optional: it defaults to
170 The possible options are:
181 \- Shows ignored files and directories, unless \-\-untracked\-files=all is specified, in which case individual files in ignored directories are displayed\&.
193 \- Show no ignored files\&.
205 \- Shows ignored files and directories matching an ignore pattern\&.
210 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\&.
215 Terminate entries with NUL, instead of LF\&. This implies the
216 \fB\-\-porcelain=v1\fR
217 output format if no other format is given\&.
220 \-\-column[=<options>], \-\-no\-column
222 Display untracked files in columns\&. See configuration variable
223 \fBcolumn\&.status\fR
228 without options are equivalent to
235 \-\-ahead\-behind, \-\-no\-ahead\-behind
237 Display or do not display detailed ahead/behind counts for the branch relative to its upstream branch\&. Defaults to true\&.
240 \-\-renames, \-\-no\-renames
242 Turn on/off rename detection regardless of user configuration\&. See also
244 \fB\-\-no\-renames\fR\&.
247 \-\-find\-renames[=<n>]
249 Turn on rename detection, optionally setting the similarity threshold\&. See also
251 \fB\-\-find\-renames\fR\&.
259 \fBgitglossary\fR(7)\&.
263 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\&.
265 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\&.
268 In the short\-format, the status of each path is shown as one of these forms
275 XY ORIG_PATH \-> PATH
281 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\&.
283 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\&.
285 There are three different types of states that are shown using this format, and each one uses the \fBXY\fR syntax differently:
295 When a merge is occurring and the merge was successful, or outside of a merge situation,
297 shows the status of the index and
299 shows the status of the working tree\&.
310 When a merge conflict has occurred and has not yet been resolved,
314 show the state introduced by each head of the merge, relative to the common ancestor\&. These paths are said to be
326 When a path is untracked,
330 are always the same, since they are unknown to the index\&.
332 is used for untracked paths\&. Ignored files are not listed unless
334 is used; if it is, ignored files are indicated by
338 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\&.
340 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:
350 \*(Aq \*(Aq = unmodified
374 = file type changed (regular file, symbolic link or submodule)
422 = copied (if config option status\&.renames is set to "copies")
434 = updated but unmerged
442 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
444 M [ MTD] updated in index
445 T [ MTD] type changed in index
446 A [ MTD] added to index
448 R [ MTD] renamed in index
449 C [ MTD] copied in index
450 [MTARC] index and work tree matches
451 [ MTARC] M work tree changed since index
452 [ MTARC] T type changed in work tree since index
453 [ MTARC] D deleted in work tree
454 R renamed in work tree
455 C copied in work tree
456 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
457 D D unmerged, both deleted
458 A U unmerged, added by us
459 U D unmerged, deleted by them
460 U A unmerged, added by them
461 D U unmerged, deleted by us
462 A A unmerged, both added
463 U U unmerged, both modified
464 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
467 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
473 Submodules have more state and instead report
484 = the submodule has a different HEAD than recorded in the index
496 = the submodule has modified content
508 = the submodule has untracked files
511 This is since modified content or untracked files in a submodule cannot be added via \fBgit add\fR in the superproject to prepare a commit\&.
513 \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\&.
515 If \-b is used the short\-format status is preceded by a line
521 ## branchname tracking info
526 .SS "Porcelain Format Version 1"
528 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:
538 The user\(cqs color\&.status configuration is not respected; color will always be off\&.
549 The user\(cqs status\&.relativePaths configuration is not respected; paths shown will always be relative to the repository root\&.
552 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\&.
554 Any submodule changes are reported as modified \fBM\fR instead of \fBm\fR or single \fB?\fR\&.
555 .SS "Porcelain Format Version 2"
557 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\&.
559 Header lines start with "#" and are added in response to specific command line arguments\&. Parsers should ignore headers they don\(cqt recognize\&.
562 .nr an-no-space-flag 1
569 If \fB\-\-branch\fR is given, a series of header lines are printed with information about the current branch\&.
576 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
577 # branch\&.oid <commit> | (initial) Current commit\&.
578 # branch\&.head <branch> | (detached) Current branch\&.
579 # branch\&.upstream <upstream\-branch> If upstream is set\&.
580 # branch\&.ab +<ahead> \-<behind> If upstream is set and
581 the commit is present\&.
582 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
590 .nr an-no-space-flag 1
594 \fBStash Information\fR
597 If \fB\-\-show\-stash\fR is given, one line is printed showing the number of stash entries if non\-zero:
611 .nr an-no-space-flag 1
615 \fBChanged Tracked Entries\fR
618 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\&.
620 Ordinary changed entries have the following format:
626 1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path>
632 Renamed or copied entries have the following format:
638 2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>
649 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
650 <XY> A 2 character field containing the staged and
651 unstaged XY values described in the short format,
652 with unchanged indicated by a "\&." rather than
654 <sub> A 4 character field describing the submodule state\&.
655 "N\&.\&.\&." when the entry is not a submodule\&.
656 "S<c><m><u>" when the entry is a submodule\&.
657 <c> is "C" if the commit changed; otherwise "\&."\&.
658 <m> is "M" if it has tracked changes; otherwise "\&."\&.
659 <u> is "U" if there are untracked changes; otherwise "\&."\&.
660 <mH> The octal file mode in HEAD\&.
661 <mI> The octal file mode in the index\&.
662 <mW> The octal file mode in the worktree\&.
663 <hH> The object name in HEAD\&.
664 <hI> The object name in the index\&.
665 <X><score> The rename or copy score (denoting the percentage
666 of similarity between the source and target of the
667 move or copy)\&. For example "R100" or "C75"\&.
668 <path> The pathname\&. In a renamed/copied entry, this
669 is the target path\&.
670 <sep> When the `\-z` option is used, the 2 pathnames are separated
671 with a NUL (ASCII 0x00) byte; otherwise, a tab (ASCII 0x09)
672 byte separates them\&.
673 <origPath> The pathname in the commit at HEAD or in the index\&.
674 This is only present in a renamed/copied entry, and
675 tells where the renamed/copied contents came from\&.
676 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
682 Unmerged entries have the following format; the first character is a "u" to distinguish from ordinary changed entries\&.
688 u <XY> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path>
699 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
700 <XY> A 2 character field describing the conflict type
701 as described in the short format\&.
702 <sub> A 4 character field describing the submodule state
703 as described above\&.
704 <m1> The octal file mode in stage 1\&.
705 <m2> The octal file mode in stage 2\&.
706 <m3> The octal file mode in stage 3\&.
707 <mW> The octal file mode in the worktree\&.
708 <h1> The object name in stage 1\&.
709 <h2> The object name in stage 2\&.
710 <h3> The object name in stage 3\&.
711 <path> The pathname\&.
712 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
720 .nr an-no-space-flag 1
727 Following the tracked entries (and if requested), a series of lines will be printed for untracked and then ignored items found in the worktree\&.
729 Untracked items have the following format:
741 Ignored items have the following format:
755 .nr an-no-space-flag 1
759 \fBPathname Format Notes and -z\fR
762 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\&.
764 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))\&.
768 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\&.
770 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\&.
772 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\&.
773 .SH "BACKGROUND REFRESH"
775 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)\&.
776 .SH "UNTRACKED FILES AND PERFORMANCE"
778 \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\&.
789 \fB\-\-untracked\-files=no\fR
791 \fBstatus\&.showUntrackedFiles=no\fR
792 config (see above for both): indicate that
794 should not report untracked files\&. This is the fastest option\&.
796 will not list the untracked files, so you need to be careful to remember if you create any new files and manually
809 \fBadvice\&.statusUoption=false\fR
811 \fBgit-config\fR(1)): setting this variable to
813 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\&.
824 \fBcore\&.untrackedCache=true\fR
826 \fBgit-update-index\fR(1)): enable the untracked cache feature and only search directories that have been modified since the previous
828 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
830 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\&.
841 \fBcore\&.untrackedCache=true\fR
843 \fBcore\&.fsmonitor=true\fR
845 \fBcore\&.fsmonitor=<hook\-command\-pathname>\fR
847 \fBgit-update-index\fR(1)): enable both the untracked cache and FSMonitor features and only search directories that have been modified since the previous
849 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\&.
852 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\&.
858 Part of the \fBgit\fR(1) suite