# info > GIT-STATUS

---
type: CommandReference
command: git-status
mode: man
section: 1
source: man-pages
---

## Quick Reference
- `git status` — show working tree status in long format
- `git status -s` — short format output
- `git status -b` — include branch and tracking info in short format
- `git status --porcelain` — machine-parseable format (v1 stable)
- `git status -v` — show staged textual changes; `-vv` adds unstaged changes
- `git status -uno` — hide untracked files
- `git status --ignored` — show ignored files
- `git status -z` — NUL-terminated output for scripting

## Name
git-status — Show the working tree status

## Synopsis
shell
git status [<options>...] [--] [<pathspec>...]
## Options
- `-s, --short` — short format output
- `-b, --branch` — show branch and tracking info (even in short format)
- `--show-stash` — show number of stashed entries
- `--porcelain[=<version>]` — stable, machine-readable output (v1 default). Use `-z` for NUL separation.
- `--long` — long format (default)
- `-v, --verbose` — show staged changes; `-vv` also shows unstaged changes
- `-u[<mode>], --untracked-files[=<mode>]` — handle untracked files: `no`, `normal` (default), `all` (show individual files in untracked dirs)
- `--ignore-submodules[=<when>]` — ignore submodule changes: `none`, `untracked`, `dirty`, `all` (default)
- `--ignored[=<mode>]` — show ignored files: `traditional` (default), `no`, `matching` (show files matching ignore patterns)
- `-z` — terminate entries with NUL, imply `--porcelain=v1`
- `--column[=<options>], --no-column` — display untracked files in columns
- `--ahead-behind, --no-ahead-behind` — show/hide ahead/behind counts (default true)
- `--renames, --no-renames` — turn on/off rename detection
- `--find-renames[=<n>]` — turn on rename detection with optional similarity threshold
- `<pathspec>...` — limit status to matching paths

## Output
Paths are relative to current directory (unless `status.relativePaths=false`).

### Short Format
Each line: `XY PATH` or `XY ORIG_PATH -> PATH` (for renames/copies). `XY` is a two‑letter status code.

**For tracked entries (X = index, Y = worktree):**
- `' '` = unmodified
- `M` = modified
- `T` = file type changed
- `A` = added
- `D` = deleted
- `R` = renamed
- `C` = copied (if `status.renames=copies`)
- `U` = updated but unmerged (during merge conflicts)

| X       | Y       | Meaning                        |
|---------|---------|--------------------------------|
|         | [AMD]   | not updated                    |
| M       | [ MTD]  | updated in index               |
| T       | [ MTD]  | type changed in index          |
| A       | [ MTD]  | added to index                 |
| D       |         | deleted from index             |
| R       | [ MTD]  | renamed in index               |
| C       | [ MTD]  | copied in index                |
| [MTARC] |         | index and worktree match       |
| [MTARC] | M       | worktree changed since index   |
| [MTARC] | T       | type changed in worktree       |
| [MTARC] | D       | deleted in worktree            |
|         | R       | renamed in worktree            |
| C       |         | copied in worktree             |

**Unmerged entries (X and Y show merge heads):**
| X | Y | Meaning                     |
|---|---|-----------------------------|
| D | D | unmerged, both deleted      |
| A | U | unmerged, added by us       |
| U | D | unmerged, deleted by them   |
| U | A | unmerged, added by them     |
| D | U | unmerged, deleted by us     |
| A | A | unmerged, both added        |
| U | U | unmerged, both modified     |

**Untracked and ignored:**
- `??` — untracked
- `!!` — ignored (only with `--ignored`)

**Submodule states:**
- `M` — HEAD differs from recorded commit
- `m` — modified content
- `?` — untracked files (recursive)

With `-b`, prepend line: `## branchname tracking info`.

### Porcelain Format Version 1
Identical to short format but:
- Colors disabled
- Paths relative to repository root
- With `-z`: rename entries reversed (`to from`), NUL‑separated filenames, no quoting
- Submodule changes shown as `M` (not `m` or `?`)

### Porcelain Format Version 2
Extensible headers and detailed entry lines.

**Branch headers** (when `--branch`):
# branch.oid <commit> | (initial)
# branch.head <branch> | (detached)
# branch.upstream <upstream_branch>
# branch.ab +<ahead> -<behind>
**Tracked entries** (one of three formats):
- Ordinary: `1 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <path>`
- Renamed/copied: `2 <XY> <sub> <mH> <mI> <mW> <hH> <hI> <X><score> <path><sep><origPath>`
- Unmerged: `u <XY> <sub> <m1> <m2> <m3> <mW> <h1> <h2> <h3> <path>`

Fields:
- `<XY>` — two‑char status, unchanged dots instead of spaces
- `<sub>` — submodule state: `N...` or `S<c><m><u>` (C=commit changed, M=tracked changes, U=untracked)
- `<mH>`, `<mI>`, `<mW>` — octal file modes in HEAD, index, worktree
- `<hH>`, `<hI>` — object names in HEAD and index
- `<X><score>` — rename/copy score (e.g., `R100`, `C75`)
- `<sep>` — tab (or NUL with `-z`)
- `<origPath>` — source path for renames/copies

**Untracked/ignored items:**
- `? <path>` — untracked
- `! <path>` — ignored

With `-z`, no quoting and NUL terminators.

## See Also
- [`gitignore(5)`](http://localhost/phpMan.php/man/gitignore/5/markdown)
- [`git(1)`](http://localhost/phpMan.php/man/git/1/markdown)
- [`git-diff(1)`](http://localhost/phpMan.php/man/git-diff/1/markdown)
- [`git-config(1)`](http://localhost/phpMan.php/man/git-config/1/markdown)
- [`gitmodules(5)`](http://localhost/phpMan.php/man/gitmodules/5/markdown)
- [`gitglossary(7)`](http://localhost/phpMan.php/man/gitglossary/7/markdown)
- [`git-submodule(1)`](http://localhost/phpMan.php/man/git-submodule/1/markdown)