Documentation / git-status.txton commit Merge branch 'fk/doc-format-patch-vn' into maint (a15ebbc)
   1git-status(1)
   2=============
   3
   4NAME
   5----
   6git-status - Show the working tree status
   7
   8
   9SYNOPSIS
  10--------
  11[verse]
  12'git status' [<options>...] [--] [<pathspec>...]
  13
  14DESCRIPTION
  15-----------
  16Displays paths that have differences between the index file and the
  17current HEAD commit, paths that have differences between the working
  18tree and the index file, and paths in the working tree that are not
  19tracked by Git (and are not ignored by linkgit:gitignore[5]). The first
  20are what you _would_ commit by running `git commit`; the second and
  21third are what you _could_ commit by running 'git add' before running
  22`git commit`.
  23
  24OPTIONS
  25-------
  26
  27-s::
  28--short::
  29        Give the output in the short-format.
  30
  31-b::
  32--branch::
  33        Show the branch and tracking info even in short-format.
  34
  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.
  40
  41--long::
  42        Give the output in the long-format. This is the default.
  43
  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`).
  51
  52-u[<mode>]::
  53--untracked-files[=<mode>]::
  54        Show untracked files.
  55+
  56The mode parameter is optional (defaults to 'all'), and is used to
  57specify the handling of untracked files.
  58+
  59The 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+
  65When `-u` option is not used, untracked files and directories are
  66shown (i.e. the same as specifying `normal`), to help you avoid
  67forgetting to add newly created files.  Because it takes extra work
  68to find untracked files in the filesystem, this mode may take some
  69time in a large working tree.  You can use `no` to have `git status`
  70return more quickly without showing untracked files.
  71+
  72The default can be changed using the status.showUntrackedFiles
  73configuration variable documented in linkgit:git-config[1].
  74
  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).
  89
  90--ignored::
  91        Show ignored files as well.
  92
  93-z::
  94        Terminate entries with NUL, instead of LF.  This implies
  95        the `--porcelain` output format if no other format is given.
  96
  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.
 103
 104
 105OUTPUT
 106------
 107The output from this command is designed to be used as a commit
 108template comment.
 109The default, long format, is designed to be human readable,
 110verbose and descriptive.  Its contents and format are subject to change
 111at any time.
 112
 113The paths mentioned in the output, unlike many other Git commands, are
 114made relative to the current directory if you are working in a
 115subdirectory (this is on purpose, to help cutting and pasting). See
 116the status.relativePaths config option below.
 117
 118Short Format
 119~~~~~~~~~~~~
 120
 121In the short-format, the status of each path is shown as
 122
 123        XY PATH1 -> PATH2
 124
 125where `PATH1` is the path in the `HEAD`, and the " `-> PATH2`" part is
 126shown only when `PATH1` corresponds to a different path in the
 127index/worktree (i.e. the file is renamed). The `XY` is a two-letter
 128status code.
 129
 130The fields (including the `->`) are separated from each other by a
 131single space. If a filename contains whitespace or other nonprintable
 132characters, that field will be quoted in the manner of a C string
 133literal: surrounded by ASCII double quote (34) characters, and with
 134interior special characters backslash-escaped.
 135
 136For paths with merge conflicts, `X` and `Y` show the modification
 137states of each side of the merge. For paths that do not have merge
 138conflicts, `X` shows the status of the index, and `Y` shows the status
 139of the work tree.  For untracked paths, `XY` are `??`.  Other status
 140codes can be interpreted as follows:
 141
 142* ' ' = unmodified
 143* 'M' = modified
 144* 'A' = added
 145* 'D' = deleted
 146* 'R' = renamed
 147* 'C' = copied
 148* 'U' = updated but unmerged
 149
 150Ignored files are not listed, unless `--ignored` option is in effect,
 151in which case `XY` are `!!`.
 152
 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    -------------------------------------------------
 176
 177If -b is used the short-format status is preceded by a line
 178
 179## branchname tracking info
 180
 181Porcelain Format
 182~~~~~~~~~~~~~~~~
 183
 184The porcelain format is similar to the short format, but is guaranteed
 185not to change in a backwards-incompatible way between Git versions or
 186based on user configuration. This makes it ideal for parsing by scripts.
 187The description of the short format above also describes the porcelain
 188format, with a few exceptions:
 189
 1901. The user's color.status configuration is not respected; color will
 191   always be off.
 192
 1932. The user's status.relativePaths configuration is not respected; paths
 194   shown will always be relative to the repository root.
 195
 196There is also an alternate -z format recommended for machine parsing. In
 197that format, the status field is the same, but some other things
 198change.  First, the '\->' is omitted from rename entries and the field
 199order is reversed (e.g 'from \-> to' becomes 'to from'). Second, a NUL
 200(ASCII 0) follows each filename, replacing space as a field separator
 201and the terminating newline (but a space still separates the status
 202field from the first filename).  Third, filenames containing special
 203characters are not specially formatted; no quoting or
 204backslash-escaping is performed.
 205
 206CONFIGURATION
 207-------------
 208
 209The command honors `color.status` (or `status.color` -- they
 210mean the same thing and the latter is kept for backward
 211compatibility) and `color.status.<slot>` configuration variables
 212to colorize its output.
 213
 214If the config variable `status.relativePaths` is set to false, then all
 215paths shown are relative to the repository root, not to the current
 216directory.
 217
 218If `status.submoduleSummary` is set to a non zero number or true (identical
 219to -1 or an unlimited number), the submodule summary will be enabled for
 220the long format and a summary of commits for modified submodules will be
 221shown (see --summary-limit option of linkgit:git-submodule[1]). Please note
 222that the summary output from the status command will be suppressed for all
 223submodules when `diff.ignoreSubmodules` is set to 'all' or only for those
 224submodules where `submodule.<name>.ignore=all`. To also view the summary for
 225ignored submodules you can either use the --ignore-submodules=dirty command
 226line option or the 'git submodule summary' command, which shows a similar
 227output but does not honor these settings.
 228
 229SEE ALSO
 230--------
 231linkgit:gitignore[5]
 232
 233GIT
 234---
 235Part of the linkgit:git[1] suite