THE GITHTML FIELD GUIDE

Read the two columns in git status --short

In git status --short, the first column generally describes the index relative to HEAD, and the second describes the working tree relative to the index. A file can therefore have two modification markers. Question marks identify untracked paths; unmerged entries use conflict-specific codes and need a different interpretation.

Read columns before filenames

Short status saves space by putting state into two characters. For ordinary tracked paths, M followed by a space means the modification is staged. A space followed by M means it remains unstaged. MM means the staged copy differs from HEAD and the working copy also differs from that staged copy. The file can appear twice conceptually without being duplicated on disk.

A newly created file marked ?? is untracked, so it is not yet part of the next commit. A staged new file uses A in the index column. Deletions can also be staged or unstaged, and renames may display an old and new path. Always read the complete line, especially when paths contain spaces or quoting.

Use long status to resolve ambiguity

Run the compact and expanded forms together while learning. Long status groups paths under explanations and, during an operation, often describes the next appropriate step. Branch information is optional in short format; adding --branch gives useful context without changing repository contents. These commands are inspections, not staging or cleanup operations.

  1. For an MM entry, run both git diff -- path and git diff --staged -- path to inspect the two versions independently.
  2. For a conflict code such as UU, read the operation summary and resolve the conflict rather than treating the two letters as normal modification columns.
shell
git status --short
git status --short --branch
git status

Apply the result to a commit review

Suppose you changed a parser and also generated a local trace file. The parser might show M in one or both columns; the trace might show ??. Stage only the parser changes that belong in the fix, then inspect status again. This turns the output into a checklist of deliberate inclusions and exclusions instead of a goal to make every line disappear.

Status does not contact your remote server. Ahead or behind information describes locally known tracking refs and can be stale until a fetch. A clean working tree also says nothing about whether commits have been pushed or merged. For scripts, use a documented porcelain format rather than parsing colored human-oriented output. For everyday reading, the two-column model and the long-form explanation are usually enough to identify the next safe action.

When requesting help, preserve the leading spaces in short output. Removing them can change whether a line appears to describe staged or unstaged content.

Sources and further reading

AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.

All git fundamentals guides →

Read as MarkdownAll guides

Read the two columns in git status --short · gitHtml