Merge branch 'mg/status-v-v'
[git/git.git] / Documentation / git-status.txt
1 git-status(1)
2 =============
5 ----
6 git-status - Show the working tree status
10 --------
11 [verse]
12 'git status' [<options>...] [--] [<pathspec>...]
15 -----------
16 Displays paths that have differences between the index file and the
17 current HEAD commit, paths that have differences between the working
18 tree and the index file, and paths in the working tree that are not
19 tracked by Git (and are not ignored by linkgit:gitignore[5]). The first
20 are what you _would_ commit by running `git commit`; the second and
21 third are what you _could_ commit by running 'git add' before running
22 `git commit`.
25 -------
27 -s::
28 --short::
29 Give the output in the short-format.
31 -b::
32 --branch::
33 Show the branch and tracking info even in short-format.
35 --porcelain::
36 Give the output in an easy-to-parse format for scripts.
37 This is similar to the short output, but will remain stable
38 across Git versions and regardless of user configuration. See
39 below for details.
41 --long::
42 Give the output in the long-format. This is the default.
44 -v::
45 --verbose::
46 In addition to the names of files that have been changed, also
47 show the textual changes that are staged to be committed
48 (i.e., like the output of `git diff --cached`). If `-v` is specified
49 twice, then also show the changes in the working tree that
50 have not yet been staged (i.e., like the output of `git diff`).
52 -u[<mode>]::
53 --untracked-files[=<mode>]::
54 Show untracked files.
55 +
56 The mode parameter is optional (defaults to 'all'), and is used to
57 specify the handling of untracked files.
58 +
59 The possible options are:
60 +
61 - 'no' - Show no untracked files.
62 - 'normal' - Shows untracked files and directories.
63 - 'all' - Also shows individual files in untracked directories.
64 +
65 When `-u` option is not used, untracked files and directories are
66 shown (i.e. the same as specifying `normal`), to help you avoid
67 forgetting to add newly created files. Because it takes extra work
68 to find untracked files in the filesystem, this mode may take some
69 time in a large working tree. You can use `no` to have `git status`
70 return more quickly without showing untracked files.
71 +
72 The default can be changed using the status.showUntrackedFiles
73 configuration variable documented in linkgit:git-config[1].
75 --ignore-submodules[=<when>]::
76 Ignore changes to submodules when looking for changes. <when> can be
77 either "none", "untracked", "dirty" or "all", which is the default.
78 Using "none" will consider the submodule modified when it either contains
79 untracked or modified files or its HEAD differs from the commit recorded
80 in the superproject and can be used to override any settings of the
81 'ignore' option in linkgit:git-config[1] or linkgit:gitmodules[5]. When
82 "untracked" is used submodules are not considered dirty when they only
83 contain untracked content (but they are still scanned for modified
84 content). Using "dirty" ignores all changes to the work tree of submodules,
85 only changes to the commits stored in the superproject are shown (this was
86 the behavior before 1.7.0). Using "all" hides all changes to submodules
87 (and suppresses the output of submodule summaries when the config option
88 `status.submoduleSummary` is set).
90 --ignored::
91 Show ignored files as well.
93 -z::
94 Terminate entries with NUL, instead of LF. This implies
95 the `--porcelain` output format if no other format is given.
97 --column[=<options>]::
98 --no-column::
99 Display untracked files in columns. See configuration variable
100 column.status for option syntax.`--column` and `--no-column`
101 without options are equivalent to 'always' and 'never'
102 respectively.
106 ------
107 The output from this command is designed to be used as a commit
108 template comment.
109 The default, long format, is designed to be human readable,
110 verbose and descriptive. Its contents and format are subject to change
111 at any time.
113 The paths mentioned in the output, unlike many other Git commands, are
114 made relative to the current directory if you are working in a
115 subdirectory (this is on purpose, to help cutting and pasting). See
116 the status.relativePaths config option below.
118 Short Format
119 ~~~~~~~~~~~~
121 In the short-format, the status of each path is shown as
123 XY PATH1 -> PATH2
125 where `PATH1` is the path in the `HEAD`, and the " `-> PATH2`" part is
126 shown only when `PATH1` corresponds to a different path in the
127 index/worktree (i.e. the file is renamed). The `XY` is a two-letter
128 status code.
130 The fields (including the `->`) are separated from each other by a
131 single space. If a filename contains whitespace or other nonprintable
132 characters, that field will be quoted in the manner of a C string
133 literal: surrounded by ASCII double quote (34) characters, and with
134 interior special characters backslash-escaped.
136 For paths with merge conflicts, `X` and `Y` show the modification
137 states of each side of the merge. For paths that do not have merge
138 conflicts, `X` shows the status of the index, and `Y` shows the status
139 of the work tree. For untracked paths, `XY` are `??`. Other status
140 codes can be interpreted as follows:
142 * ' ' = unmodified
143 * 'M' = modified
144 * 'A' = added
145 * 'D' = deleted
146 * 'R' = renamed
147 * 'C' = copied
148 * 'U' = updated but unmerged
150 Ignored files are not listed, unless `--ignored` option is in effect,
151 in which case `XY` are `!!`.
153 X Y Meaning
154 -------------------------------------------------
155 [MD] not updated
156 M [ MD] updated in index
157 A [ MD] added to index
158 D [ M] deleted from index
159 R [ MD] renamed in index
160 C [ MD] copied in index
161 [MARC] index and work tree matches
162 [ MARC] M work tree changed since index
163 [ MARC] D deleted in work tree
164 -------------------------------------------------
165 D D unmerged, both deleted
166 A U unmerged, added by us
167 U D unmerged, deleted by them
168 U A unmerged, added by them
169 D U unmerged, deleted by us
170 A A unmerged, both added
171 U U unmerged, both modified
172 -------------------------------------------------
173 ? ? untracked
174 ! ! ignored
175 -------------------------------------------------
177 If -b is used the short-format status is preceded by a line
179 ## branchname tracking info
181 Porcelain Format
182 ~~~~~~~~~~~~~~~~
184 The porcelain format is similar to the short format, but is guaranteed
185 not to change in a backwards-incompatible way between Git versions or
186 based on user configuration. This makes it ideal for parsing by scripts.
187 The description of the short format above also describes the porcelain
188 format, with a few exceptions:
190 1. The user's color.status configuration is not respected; color will
191 always be off.
193 2. The user's status.relativePaths configuration is not respected; paths
194 shown will always be relative to the repository root.
196 There is also an alternate -z format recommended for machine parsing. In
197 that format, the status field is the same, but some other things
198 change. First, the '\->' is omitted from rename entries and the field
199 order is reversed (e.g 'from \-> to' becomes 'to from'). Second, a NUL
200 (ASCII 0) follows each filename, replacing space as a field separator
201 and the terminating newline (but a space still separates the status
202 field from the first filename). Third, filenames containing special
203 characters are not specially formatted; no quoting or
204 backslash-escaping is performed.
207 -------------
209 The command honors `color.status` (or `status.color` -- they
210 mean the same thing and the latter is kept for backward
211 compatibility) and `color.status.<slot>` configuration variables
212 to colorize its output.
214 If the config variable `status.relativePaths` is set to false, then all
215 paths shown are relative to the repository root, not to the current
216 directory.
218 If `status.submoduleSummary` is set to a non zero number or true (identical
219 to -1 or an unlimited number), the submodule summary will be enabled for
220 the long format and a summary of commits for modified submodules will be
221 shown (see --summary-limit option of linkgit:git-submodule[1]). Please note
222 that the summary output from the status command will be suppressed for all
223 submodules when `diff.ignoreSubmodules` is set to 'all' or only for those
224 submodules where `submodule.<name>.ignore=all`. To also view the summary for
225 ignored submodules you can either use the --ignore-submodules=dirty command
226 line option or the 'git submodule summary' command, which shows a similar
227 output but does not honor these settings.
230 --------
231 linkgit:gitignore[5]
233 GIT
234 ---
235 Part of the linkgit:git[1] suite