Linux "git-status" Command Line Options and Examples
Show the working tree status

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)).


Usage:

git status [...] [--] [...]






Command Line Options:

-s
Give the output in the short-format.
git-status -s ...
-b
Show the branch and tracking info even in short-format.
git-status -b ...
--show-stash
Show the number of entries currently stashed away.
git-status --show-stash ...
--porcelain[
Give the output in an easy-to-parse format for scripts. This is similar to the short output, but will remain stable across Gitversions and regardless of user configuration. See below for details.The version parameter is used to specify the format version. This is optional and defaults to the original version v1 format.
git-status --porcelain[ ...
--long
Give the output in the long-format. This is the default.
git-status --long ...
-v
In addition to the names of files that have been changed, also show the textual changes that are staged to be committed (i.e.,like the output of git diff --cached). If -v is specified twice, then also show the changes in the working tree that have not yetbeen staged (i.e., like the output of git diff).
git-status -v ...
-u[<mode>]
Show untracked files.The mode parameter is used to specify the handling of untracked files. It is optional: it defaults to all, and if specified, itmust be stuck to the option (e.g. -uno, but not -u no).The possible options are:· no - Show no untracked files.· normal - Shows untracked files and directories.· all - Also shows individual files in untracked directories.When -u option is not used, untracked files and directories are shown (i.e. the same as specifying normal), to help you avoidforgetting to add newly created files. Because it takes extra work to find untracked files in the filesystem, this mode maytake some time in a large working tree. Consider enabling untracked cache and split index if supported (see git update-index
git-status -u[<mode>] ...
--ignore-submodules[
Ignore changes to submodules when looking for changes. <when> can be either "none", "untracked", "dirty" or "all", which is thedefault. Using "none" will consider the submodule modified when it either contains untracked or modified files or its HEADdiffers from the commit recorded in the superproject and can be used to override any settings of the ignore option in git-config(1) or gitmodules(5). When "untracked" is used submodules are not considered dirty when they only contain untracked content(but they are still scanned for modified content). Using "dirty" ignores all changes to the work tree of submodules, only changesto the commits stored in the superproject are shown (this was the behavior before 1.7.0). Using "all" hides all changes tosubmodules (and suppresses the output of submodule summaries when the config option status.submoduleSummary is set).
git-status --ignore-submodules[ ...
--ignored[
Show ignored files as well.The mode parameter is used to specify the handling of ignored files. It is optional: it defaults to traditional.The possible options are:· traditional - Shows ignored files and directories, unless --untracked-files=all is specifed, in which case individual filesin ignored directories are displayed.· no - Show no ignored files.· matching - Shows ignored files and directories matching an ignore pattern.When matching mode is specified, paths that explicity match an ignored pattern are shown. If a directory matches an ignorepattern, then it is shown, but not paths contained in the ignored directory. If a directory does not match an ignore pattern,but all contents are ignored, then the directory is not shown, but all contents are shown.
git-status --ignored[ ...
-z
Terminate entries with NUL, instead of LF. This implies the --porcelain=v1 output format if no other format is given.
git-status -z ...
--column[
Display untracked files in columns. See configuration variable column.status for option syntax.--column and --no-column withoutoptions are equivalent to always and never respectively.
git-status --column[ ...
--ahead-behind
Display or do not display detailed ahead/behind counts for the branch relative to its upstream branch. Defaults to true.<pathspec>...See the pathspec entry in gitglossary(7).OUTPUTThe output from this command is designed to be used as a commit template comment. The default, long format, is designed to be humanreadable, verbose and descriptive. Its contents and format are subject to change at any time.The paths mentioned in the output, unlike many other Git commands, are made relative to the current directory if you are working in asubdirectory (this is on purpose, to help cutting and pasting). See the status.relativePaths config option below.Short FormatIn the short-format, the status of each path is shown as one of these formsXY PATHXY ORIG_PATH -> PATHwhere ORIG_PATH is where the renamed/copied contents came from. ORIG_PATH is only shown when the entry is renamed or copied. The XYis a two-letter status code.The fields (including the ->) are separated from each other by a single space. If a filename contains whitespace or othernonprintable characters, that field will be quoted in the manner of a C string literal: surrounded by ASCII double quote (34)characters, and with interior special characters backslash-escaped.For paths with merge conflicts, X and Y show the modification states of each side of the merge. For paths that do not have mergeconflicts, X shows the status of the index, and Y shows the status of the work tree. For untracked paths, XY are ??. Other statuscodes can be interpreted as follows:· ' ' = unmodified· M = modified· A = added· D = deleted· R = renamed· C = copied· U = updated but unmergedIgnored files are not listed, unless --ignored option is in effect, in which case XY are !!.X Y Meaning
git-status --ahead-behind ...