Anonymous contributor's avatar
Anonymous contributor
Anonymous contributor's avatar
Anonymous contributor
Published Nov 4, 2021Updated Apr 22, 2024
Contribute to Docs

In Git, the status command shows the state of the working directory, staging area, and which files are untracked (names shown in red and not staged) or tracked (shown in green and staged). The tracked files, shown in green, are found in the staging area and will be saved with the next commit.


Below is a short example of how the git status command works. Running git status will show the following, assuming a change was saved in a text file example.txt (but not added to the staging area) and README.txt is a new file that was added to the staging area:

$ git status
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: README.txt
Untracked files:
(use "git add <file>..." to include in what will be committed)

All contributors

Looking to contribute?

Learn Git on Codecademy