Skip to content
Tutorials Center
My learning

Topics

Git Reference ยท Configuration Options

status.* settings

Reference for status.* settings: status.short, status.branch, status.showUntrackedFiles, status.aheadBehind, status.renames and status.showStash, with examples.

The status.* variables set the defaults for git status. The command is one you run dozens of times a day, so small defaults matter: the short two-column format instead of the long prose, the branch line, how untracked directories are listed, and whether Git spends time counting commits ahead of and behind upstream.

Every setting here has a matching command-line option, and the option wins over the configuration. IDE integrations and prompts that call git status --porcelain are not affected by most of these, because porcelain output is fixed on purpose.

Terminal
git config --global status.short true
git config --global status.branch true
git config --global status.showUntrackedFiles all
git config --global status.showStash true

Try it

Bash Short format, branch line and untracked files

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Bash Ahead/behind counts, renames and stash

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Syntax

Terminal
git config status.<name> <value>
Setting Values Description
status.short true, false Use the short format (git status -s) by default.
status.branch true, false Show the branch and tracking line (git status -b), also in short format.
status.showUntrackedFiles no, normal, all normal lists untracked directories as one entry, all lists every file inside, no hides untracked files. Default normal.
status.aheadBehind true, false Compute "ahead N, behind M" for the branch. When false, Git only says that the branches differ, which is faster in huge repositories. Default true.
status.renames true, false, copies Detect renames (or copies) between HEAD and the index and between the index and the working tree. Falls back to diff.renames.
status.relativePaths true, false Show paths relative to the current directory. Default true.
status.submoduleSummary true, false, number Include a summary of submodule commits. A number limits the entries; -1 means unlimited.
status.showStash true, false Print the number of stash entries (git status --show-stash).
status.displayCommentPrefix true, false Prefix long-format lines with the comment character, as in a commit message template. Default false.

Edge cases: the command-line options --short, --long, --branch, --untracked-files=<mode>, --ahead-behind, --no-ahead-behind, --renames and --no-renames override these settings. --porcelain ignores status.short and status.branch so scripts keep working.

Usage notes

  • Short format column meanings: the first column is the index versus HEAD, the second is the working tree versus the index. ?? is untracked, !! is ignored (shown only with --ignored), and UU is an unresolved conflict. In -b mode the first line is ## main...origin/main [ahead 1].
  • showUntrackedFiles=no is a trade-off. On a repository with a million files, scanning for untracked files is the slowest part of git status. Turning it off makes status fast, but you will no longer notice files you forgot to add. See core.fsmonitor and the untracked cache for a gentler approach.
  • aheadBehind=false helps on very large histories, where counting commits between two remote-heavy branches takes noticeable time. Without the counts you still see whether the branches have diverged.
  • Scripts should not depend on user configuration. Use git status --porcelain=v2 and pass the options you need explicitly; that output is stable across versions and user settings.
  • Pair status.short with status.branch: the short format on its own hides which branch you are on, and that is easy to forget.
  • Remote-tracking information in the long format (Your branch is ahead of 'origin/main' by 1 commit) comes from the branch's configured upstream; see branch.*.
  • Ignore rules are read through .gitignore and core.excludesFile; status.* only changes how results are displayed.