info > GIT-STATUS(1)

📖 NAME

git-status - 🖥️ Show the working tree status

🚀 Quick Reference

Use CaseCommandDescription
📄 Short statusgit status -sShow status in compact short format
🏷️ Show branch infogit status -bInclude branch and tracking information
🔍 Verbose staged changesgit status -vShow staged textual differences
📂 Show untracked filesgit status -uDisplay untracked files (default: normal)
🚫 Show ignored filesgit status --ignoredList ignored files as well
🤖 Machine-readable outputgit status --porcelainStable format for scripts (v1 or v2)
💾 Stash informationgit status --show-stashShow number of stashed entries

📋 SYNOPSIS

git status [<options>...] [--] [<pathspec>...]

📝 DESCRIPTION

Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index file, and paths in the working tree that are not tracked by Git (and are not ignored by gitignore(5)). The first are what you would commit by running git commit; the second and third are what you could commit by running git add before running git commit.

🔧 OPTIONS

🔹 -s, --short

📄 Give the output in the short-format.

🔹 -b, --branch

🏷️ Show the branch and tracking info even in short-format.

🔹 --show-stash

💾 Show the number of entries currently stashed away.

🔹 --porcelain[=<version>]

🤖 Give the output in an easy-to-parse format for scripts. Similar to short output, but stable across Git versions and regardless of user configuration. The version parameter (optional, defaults to v1) specifies the format version.

🔹 --long

📃 Give the output in the long-format (default).

🔹 -v, --verbose

🔍 In addition to changed file names, also show staged textual changes (like git diff --cached). Use -vv to also show unstaged working tree changes.

🔹 -u[<mode>], --untracked-files[=<mode>]

📂 Show untracked files. Mode can be:

💡 Consider enabling untracked cache or split index for performance in large working trees. The default can be changed via status.showUntrackedFiles configuration.

🔹 --ignore-submodules[=<when>]

📦 Ignore changes to submodules. <when> values:

🔹 --ignored[=<mode>]

🚫 Show ignored files as well. Mode can be:

🔹 -z

🔌 Terminate entries with NUL instead of LF. Implies --porcelain=v1 if no other format given.

🔹 --column[=<options>], --no-column

📊 Display untracked files in columns. See column.status configuration. --column = always, --no-column = never.

🔹 --ahead-behind, --no-ahead-behind

📈 Show (or hide) detailed ahead/behind counts relative to upstream branch. Default is true.

🔹 --renames, --no-renames

🔄 Enable/disable rename detection regardless of configuration. See git-diff(1) --no-renames.

🔹 --find-renames[=<n>]

🔎 Turn on rename detection with optional similarity threshold.

🔹 <pathspec>...

📁 See the pathspec entry in gitglossary(7).

📤 OUTPUT

The output from this command is designed to be used as a commit template comment. The default long format is human-readable and descriptive. Paths are relative to the current directory (see status.relativePaths).

🔹 Short Format

Status of each path shown as:

XY PATH
XY ORIG_PATH -> PATH

Where ORIG_PATH is shown for renames/copies. XY is a two-letter status code. Files with special characters are quoted in C string literal style.

Three types of states:

Status characters for tracked paths:

XYMeaning
[AMD]not updated
M[ MTD]updated in index
T[ MTD]type changed in index
A[ MTD]added to index
Ddeleted from index
R[ MTD]renamed in index
C[ MTD]copied in index
[MTARC]index and work tree matches
[ MTARC]Mwork tree changed since index
[ MTARC]Ttype changed in work tree since index
[ MTARC]Ddeleted in work tree
Rrenamed in work tree
Ccopied in work tree
DDunmerged, both deleted
AUunmerged, added by us
UDunmerged, deleted by them
UAunmerged, added by them
DUunmerged, deleted by us
AAunmerged, both added
UUunmerged, both modified
??untracked
!!ignored

Submodules: M = different HEAD, m = modified content, ? = untracked files. m and ? apply recursively.

With -b, a line ## branchname tracking info precedes the short status.

🔹 Porcelain Format Version 1

Similar to short format but stable across versions and ignores color.status and status.relativePaths configurations. Paths are relative to repository root.

With -z (NUL-terminated): rename entries omit -> and field order reversed (to from); filenames are not quoted/escaped; submodule changes reported as M.

🔹 Porcelain Format Version 2

Adds detailed information with an extensible header system. Headers start with #.

Branch Headers (with --branch)

LineNotes
# 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 commit is present.

Changed Tracked Entries

Three line formats:

FieldMeaning
<XY>2-character staged/unstaged status ( "." = unchanged).
<sub>Submodule state: N... (not submodule) or S<c><m><u> (C=commit changed, M=tracked changes, U=untracked changes).
<mH>Octal file mode in HEAD.
<mI>Octal file mode in index.
<mW>Octal file mode in worktree.
<hH>Object name in HEAD.
<hI>Object name in index.
<X><score>Rename/copy score (e.g., R100, C75).
<path>Pathname; for rename/copy, target path.
<sep>NUL with -z, tab otherwise.
<origPath>Source path for rename/copy.

Unmerged Entry Fields

FieldMeaning
<XY>Conflict type (as in short format).
<sub>Submodule state.
<m1>Octal mode in stage 1.
<m2>Octal mode in stage 2.
<m3>Octal mode in stage 3.
<mW>Octal mode in worktree.
<h1>Object name in stage 1.
<h2>Object name in stage 2.
<h3>Object name in stage 3.
<path>Pathname.

Other Items

With -z: pathnames printed as-is, NUL-terminated. Without -z: unusual characters quoted per core.quotePath.

⚙️ CONFIGURATION

The command honors color.status (or status.color) and color.status.<slot> configuration variables for colorizing output.

If status.relativePaths is false, paths are relative to repository root instead of current directory.

If status.submoduleSummary is set to non-zero or true, submodule summaries are shown in long format (see git-submodule(1) --summary-limit). Summaries are suppressed when diff.ignoreSubmodules=all or submodule.<name>.ignore=all. Use --ignore-submodules=dirty or git submodule summary to view them.

🔄 BACKGROUND REFRESH

By default, git status automatically refreshes the index by caching stat information from the working tree and writing it out. This optimization may conflict with other simultaneous processes. Scripts running status in the background should consider using git --no-optional-locks status (see git(1)).

📚 SEE ALSO

🐙 GIT

Part of the git(1) suite

GIT-STATUS(1)
📖 NAME 🚀 Quick Reference 📋 SYNOPSIS 📝 DESCRIPTION 🔧 OPTIONS
🔹 -s, --short 🔹 -b, --branch 🔹 --show-stash 🔹 --porcelain[=<version>] 🔹 --long 🔹 -v, --verbose 🔹 -u[<mode>], --untracked-files[=<mode>] 🔹 --ignore-submodules[=<when>] 🔹 --ignored[=<mode>] 🔹 -z 🔹 --column[=<options>], --no-column 🔹 --ahead-behind, --no-ahead-behind 🔹 --renames, --no-renames 🔹 --find-renames[=<n>] 🔹 <pathspec>...
📤 OUTPUT
🔹 Short Format 🔹 Porcelain Format Version 1 🔹 Porcelain Format Version 2
⚙️ CONFIGURATION 🔄 BACKGROUND REFRESH 📚 SEE ALSO 🐙 GIT

Generated by phpman v4.9.25-8-g32d6339 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-13 03:47 @216.73.217.22
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format

^_top_^