different HEAD than recorded in the index
* 'm' = the submodule has modified content
* '?' = the submodule has untracked files
This is since modified content or untracked files in a submodule cannot be added
via `git add` in the superproject to prepare a commit.
'm' and '?' are applied recursively. For example if a nested submodule
in a submodule contains an untracked file, this is reported as '?' as well.
If -b is used the short-format status is preceded by a line
## branchname tracking info
Porcelain Format Version 1
~~~~~~~~~~~~~~~~~~~~~~~~~~
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:
1. The user's color.status configuration is not respected; color will
always be off.
2. The user's status.relativePaths configuration is not respected; paths
shown will always be relative to the repository root.
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 '\->' is omitted from rename entries and the field
order is reversed (e.g 'from \-> to' becomes 'to from'). 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.
Any submodule changes are reported as modified `M` instead of `m` or single `?`.
Porcelain Format Version 2
~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
Header lines start with "#" and are added in response to specific
command line arguments. Parsers should ignore headers they
don't recognize.
Branch Headers
^^^^^^^^^^^^^^
If `--branch` is given, a series of header lines are printed with
information about the current branch.
....
Line Notes
------------------------------------------------------------
# branch.oid <commit> | (initial) Current commit.
# branch.head <branch> | (detached) Current branch.
# branch.upstream <upstream-branch> If upstream is set.
# branch.ab +<ahead> -<behind> If upstream is set and
the commit is present.
------------------------------------------------------------
....
Stash Information
^^^^^^^^^^^^^^^^^
If `--show-stash` is given, one line is printed showing the number of stash
entries if non-zero:
# stash <N>
Changed Tracked Entries
^^^^^^^^^^^^^^^^^^^^^^^
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.
Ordinary changed entries have the following format:
1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path>
Renamed or copied entries have the following format:
2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>
....
Field Meaning
--------------------------------------------------------
<XY> A 2 character field containing the staged and
unstaged XY values described in the short format,
with unchanged indicated by a "." rather than
a space.
<sub> A 4 character field describing the submodule state.
"N..." when the entry is not a submodule.
"S<c><m><u>" when the entry is a submodule.
<c> is "C" if the commit changed; otherwise ".".
<m> is "M" if it has tracked changes; otherwise ".".
<u> is "U"