Synopsis
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). The first are what you would commit by runninggit commit; the second and third are what you could commit by running git add before running git commit.
Common Usage
Options
Format Options
Format Options
-s, --shortGive the output in the short-format.-b, --branchShow the branch and tracking info even in short-format.--longGive the output in the long-format. This is the default.--porcelain[=<version>]Give the output in an easy-to-parse format for scripts. This is similar to the short output, but will remain stable across Git versions and regardless of user configuration.-zTerminate entries with NUL, instead of LF. This implies the --porcelain=v1 output format if no other format is given.Verbosity Options
Verbosity Options
-v, --verboseIn 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 yet been staged.--show-stashShow the number of entries currently stashed away.Untracked Files Options
Untracked Files Options
-u[<mode>], --untracked-files[=<mode>]Show untracked files. The mode parameter is used to specify the handling of untracked files:no- Show no untracked filesnormal- Show untracked files and directories (default)all- Also show individual files in untracked directories
-u option is not used, untracked files and directories are shown (i.e. the same as specifying normal).Ignored Files Options
Ignored Files Options
--ignored[=<mode>]Show ignored files as well. The mode parameter is optional and defaults to traditional:traditional- Show ignored files and directoriesno- Show no ignored filesmatching- Show ignored files and directories matching an ignore pattern
Submodule Options
Submodule Options
--ignore-submodules[=<when>]Ignore changes to submodules when looking for changes. The when parameter can be:none- Consider the submodule modified when it contains untracked or modified files or its HEAD differsuntracked- Submodules are not considered dirty when they only contain untracked contentdirty- Ignore all changes to the work tree of submodulesall- Hide all changes to submodules (default)
Display Options
Display Options
--column[=<options>], --no-columnDisplay untracked files in columns. --column and --no-column without options are equivalent to always and never respectively.--ahead-behind, --no-ahead-behindDisplay or do not display detailed ahead/behind counts for the branch relative to its upstream branch. Defaults to true.--renames, --no-renamesTurn on/off rename detection regardless of user configuration.--find-renames[=<n>]Turn on rename detection, optionally setting the similarity threshold.Output Format
Short Format
In the short-format, the status of each path is shown as:<xy> is a two-letter status code:
| Code | Meaning |
|---|---|
?? | Untracked |
!! | Ignored |
M | Modified in index |
M | Modified in working tree |
MM | Modified in both index and working tree |
A | Added to index |
D | Deleted from index |
D | Deleted in working tree |
R | Renamed in index |
C | Copied in index |
U | Updated but unmerged |
Long Format
The default long format is designed to be human readable and verbose:Examples
Basic status check
Short format with branch info
Show ignored files
Compact output without untracked files
Verbose output showing diffs
Check specific directory
src/ directory.
Performance Considerations
git status can be very slow in large worktrees if/when it needs to search for untracked files and directories. Several options can help:
--untracked-files=no- Don’t show untracked files (fastest option)core.untrackedCache=true- Enable the untracked cache feature to speed up untracked file detectioncore.fsmonitor=true- Use FSMonitor to track filesystem changes
Related Commands
- git add - Add file contents to the index
- git commit - Record changes to the repository
- git diff - Show changes between commits, commit and working tree, etc
- git reset - Reset current HEAD to the specified state
