Git Status

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.

  • Use our beginner friendly Git course to integrate Git and GitHub and manage versions of your projects using Git branches.
    • With Certificate
    • Beginner Friendly.
      4 hours
  • Learn about the command line, starting with navigating and manipulating the file system, and ending with redirection and configuring the environment.
    • With Certificate
    • Beginner Friendly.
      4 hours

Example

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

All contributors

Contribute to Docs

Learn Git on Codecademy

  • Use our beginner friendly Git course to integrate Git and GitHub and manage versions of your projects using Git branches.
    • With Certificate
    • Beginner Friendly.
      4 hours
  • Learn about the command line, starting with navigating and manipulating the file system, and ending with redirection and configuring the environment.
    • With Certificate
    • Beginner Friendly.
      4 hours