LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-status

Show the working tree status

TLDR

Show working tree status
$ git status
copy
Short format output
$ git status -s
copy
Show short format with branch info
$ git status -sb
copy
Show ignored files
$ git status --ignored
copy
Machine-readable output for scripting
$ git status --porcelain
copy
Show untracked files
$ git status -u
copy
Show verbose diff of staged changes
$ git status -v
copy
Show status for a specific path
$ git status [path/to/file_or_directory]
copy

SYNOPSIS

git status [options] [--] [paths...]

DESCRIPTION

git status displays the state of the working tree and the staging area. It shows which changes have been staged, which are unstaged, and which files are untracked by Git.In short format (-s), each file is shown with a two-character status code: the first column shows the index (staging area) status and the second shows the working tree status. Common codes include M (modified), A (added), D (deleted), R (renamed), ? (untracked), and ! (ignored).The --porcelain format provides stable, machine-readable output suitable for scripting, while the default long format is designed for human readability. Use --porcelain=v2 for richer machine-readable output including rename and copy information.

PARAMETERS

-s, --short

Short format output with two-column status codes (XY).
-b, --branch
Show branch and tracking info in short format.
--porcelain[=v1|v2]
Machine-readable format. Version 2 includes more detail.
-u[mode], --untracked-files[=mode]
Show untracked files. Mode can be: no, normal (default), all.
--ignored[=mode]
Show ignored files. Mode can be: traditional, no, matching.
-v, --verbose
Show staged diff. Use -vv to also show unstaged diff.
--ahead-behind
Show ahead/behind counts relative to upstream branch.
--no-ahead-behind
Suppress ahead/behind counts (faster for large repos).
--long
Long format output (default).
--column[=options]
Display untracked files in columns.
-z
Terminate entries with NUL instead of newline (for scripting).
--renames, --no-renames
Enable or disable rename detection.

SEE ALSO

Copied to clipboard
Kai