Status
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.
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 statusOn branch mainChanges to be committed:(use "git restore --staged <file>..." to unstage)new file: README.txtUntracked files:(use "git add <file>..." to include in what will be committed)example.txt
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Git on Codecademy
- Course
Learn Git & GitHub
Use our beginner friendly Git course to integrate Git and GitHub and manage versions of your projects using Git branches.With CertificateBeginner Friendly4 hours - Course
Learn the Command Line
Learn about the command line, starting with navigating and manipulating the file system, and ending with redirection and configuring the environment.With CertificateBeginner Friendly4 hours