1GIT-STATUS(1) Git Manual GIT-STATUS(1)
2
3
4
6 git-status - Show the working tree status
7
9 git status [<options>...] [--] [<pathspec>...]
10
12 Displays paths that have differences between the index file and the
13 current HEAD commit, paths that have differences between the working
14 tree and the index file, and paths in the working tree that are not
15 tracked by git (and are not ignored by gitignore(5)). The first are
16 what you would commit by running git commit; the second and third are
17 what you could commit by running git add before running git commit.
18
20 -s, --short
21 Give the output in the short-format.
22
23 -b, --branch
24 Show the branch and tracking info even in short-format.
25
26 --porcelain
27 Give the output in a stable, easy-to-parse format for scripts.
28 Currently this is identical to --short output, but is guaranteed
29 not to change in the future, making it safe for scripts.
30
31 -u[<mode>], --untracked-files[=<mode>]
32 Show untracked files.
33
34 The mode parameter is optional (defaults to all), and is used to
35 specify the handling of untracked files; when -u is not used, the
36 default is normal, i.e. show untracked files and directories.
37
38 The possible options are:
39
40 · no - Show no untracked files
41
42 · normal - Shows untracked files and directories
43
44 · all - Also shows individual files in untracked directories.
45
46 The default can be changed using the status.showUntrackedFiles
47 configuration variable documented in git-config(1).
48
49 --ignore-submodules[=<when>]
50 Ignore changes to submodules when looking for changes. <when> can
51 be either "none", "untracked", "dirty" or "all", which is the
52 default. Using "none" will consider the submodule modified when it
53 either contains untracked or modified files or its HEAD differs
54 from the commit recorded in the superproject and can be used to
55 override any settings of the ignore option in git-config(1) or
56 gitmodules(5). When "untracked" is used submodules are not
57 considered dirty when they only contain untracked content (but they
58 are still scanned for modified content). Using "dirty" ignores all
59 changes to the work tree of submodules, only changes to the commits
60 stored in the superproject are shown (this was the behavior before
61 1.7.0). Using "all" hides all changes to submodules (and suppresses
62 the output of submodule summaries when the config option
63 status.submodulesummary is set).
64
65 -z
66 Terminate entries with NUL, instead of LF. This implies the
67 --porcelain output format if no other format is given.
68
70 The output from this command is designed to be used as a commit
71 template comment, and all the output lines are prefixed with #. The
72 default, long format, is designed to be human readable, verbose and
73 descriptive. They are subject to change in any time.
74
75 The paths mentioned in the output, unlike many other git commands, are
76 made relative to the current directory if you are working in a
77 subdirectory (this is on purpose, to help cutting and pasting). See the
78 status.relativePaths config option below.
79
80 In short-format, the status of each path is shown as
81
82 XY PATH1 -> PATH2
83
84 where PATH1 is the path in the HEAD, and ` → PATH2` part is shown only
85 when PATH1 corresponds to a different path in the index/worktree (i.e.
86 the file is renamed). The XY is a two-letter status code.
87
88 The fields (including the →) are separated from each other by a single
89 space. If a filename contains whitespace or other nonprintable
90 characters, that field will be quoted in the manner of a C string
91 literal: surrounded by ASCII double quote (34) characters, and with
92 interior special characters backslash-escaped.
93
94 For paths with merge conflicts, X and Y show the modification states of
95 each side of the merge. For paths that do not have merge conflicts, X
96 shows the status of the index, and Y shows the status of the work tree.
97 For untracked paths, XY are ??. Other status codes can be interpreted
98 as follows:
99
100 · ' ' = unmodified
101
102 · M = modified
103
104 · A = added
105
106 · D = deleted
107
108 · R = renamed
109
110 · C = copied
111
112 · U = updated but unmerged
113
114 Ignored files are not listed.
115
116 X Y Meaning
117 -------------------------------------------------
118 [MD] not updated
119 M [ MD] updated in index
120 A [ MD] added to index
121 D [ M] deleted from index
122 R [ MD] renamed in index
123 C [ MD] copied in index
124 [MARC] index and work tree matches
125 [ MARC] M work tree changed since index
126 [ MARC] D deleted in work tree
127 -------------------------------------------------
128 D D unmerged, both deleted
129 A U unmerged, added by us
130 U D unmerged, deleted by them
131 U A unmerged, added by them
132 D U unmerged, deleted by us
133 A A unmerged, both added
134 U U unmerged, both modified
135 -------------------------------------------------
136 ? ? untracked
137 -------------------------------------------------
138
139 If -b is used the short-format status is preceded by a line
140
141 ## branchname tracking info
142
143 There is an alternate -z format recommended for machine parsing. In
144 that format, the status field is the same, but some other things
145 change. First, the → is omitted from rename entries and the field order
146 is reversed (e.g from → to becomes to from). Second, a NUL (ASCII 0)
147 follows each filename, replacing space as a field separator and the
148 terminating newline (but a space still separates the status field from
149 the first filename). Third, filenames containing special characters are
150 not specially formatted; no quoting or backslash-escaping is performed.
151 Fourth, there is no branch line.
152
154 The command honors color.status (or status.color — they mean the same
155 thing and the latter is kept for backward compatibility) and
156 color.status.<slot> configuration variables to colorize its output.
157
158 If the config variable status.relativePaths is set to false, then all
159 paths shown are relative to the repository root, not to the current
160 directory.
161
162 If status.submodulesummary is set to a non zero number or true
163 (identical to -1 or an unlimited number), the submodule summary will be
164 enabled for the long format and a summary of commits for modified
165 submodules will be shown (see --summary-limit option of git-
166 submodule(1)).
167
169 gitignore(5)
170
172 Written by Junio C Hamano <gitster@pobox.com[1]>.
173
175 Documentation by David Greaves, Junio C Hamano and the git-list
176 <git@vger.kernel.org[2]>.
177
179 Part of the git(1) suite
180
182 1. gitster@pobox.com
183 mailto:gitster@pobox.com
184
185 2. git@vger.kernel.org
186 mailto:git@vger.kernel.org
187
188
189
190Git 1.7.4.4 04/11/2011 GIT-STATUS(1)