w3docs logo


The git status command shows the state of the working directory and the staging area. It allows you to see staged changes and the files that aren’t being tracked by Git. The Status output does not display any information about the committed project history. For this purpose, use the git log command. The git status simply displays what has been going on with git add and git commit commands.


The git status lists which files are staged, unstaged, and untracked.

git status

Common options

-s or --short Outputs in the short-format.
-b or --branch Displays the branch and tracking information in the short-format.
--porcelain Outputs in an easy-to-parse format for scripts. It remains stable across Git versions and does not take into consideration the user configuration.
--long Outputs in the long-format (default).
-u[<mode>] --untracked-files[=<mode>] Displays the untracked files.
The mode parameter is optional is used to manage the untracked files.
The possible options are:
no - displays no untracked files.
normal - displays untracked files and directories.
all - Also displays individual files in untracked directories.
--ignore-submodules[=<when>] Ignores changes to submodules when looking for changes. <when> can be "none", "untracked", "dirty" and "all".
--ignored Displays ignored files.
-z Terminates entries with NUL. If no format is given the --porcelain output format is used.
--column[=<options>] --no-column Displays untracked files in columns. If no option is used with the --column and --no-column without options are equivalent to always and never.

Ignoring Files

Untracked files can be of two types: ones that have not been added and committed to the project and the ones that are binaries like .pyc, .obj, .exe, etc. If binaries are included in git status output, you cannot see the actual state of your repository. Thus, Git puts paths in the .gitignore file to ignore these files. The ones that you do not want to ignore, will be included on a separate line. The * symbol is used as a wildcard:



It is very important to check the state of the repository before committing any change. The following example shows the repository status before and after staging and committing:

# Edit w3docs.txt
git status
# w3docs.txt is listed under "Changes not staged for commit"
git add w3docs.txt
git status
# w3docs.txt is listed under "Changes to be committed"
git commit
git status
# nothing to commit (working directory clean)

The first status shows the unstaged file. In the second status, git add action will be followed. The third stats output shows that there is nothing to commit.