Git status Command
In this page:
What is git status?
git status is Git's core diagnostic command -- run it whenever you're unsure what state your project is in, and it will list every file that's untracked, staged, or modified since the last commit, all in one readable summary.
Example: What is git status?
git status
Reading Untracked Status
Files you've just created inside the project folder show up as Untracked -- Git has noticed them exist but is deliberately ignoring their contents until you explicitly git add them, so accidental files never sneak into history.
Example: Reading Untracked Status
echo "new content" > newfile.txt
git status
Reading Staged Status
Files listed under 'Changes to be committed' are sitting in the staging area, meaning their current state will be captured exactly as-is the next time you run git commit -- this is the section to check before committing to confirm you're saving what you meant to.
Example: Reading Staged Status
git add newfile.txt
git status
Reading Modified Status
Files under 'Changes not staged for commit' are ones Git already tracks that you've since modified -- the staged version and the working-directory version now differ, and you'll need to git add again to update what's staged.
Example: Reading Modified Status
echo "more text" >> tracked.txt
git status
Shorthand Status Check
For a large project with many changed files, the full git status output can be overwhelming -- git status -s (or --short) compresses each file to a single line with a two-letter status code, making it much faster to scan.
Example: Shorthand Status Check
git status -s
Chapter Quiz — Complete all 18 topics to unlock
0/18 topics done
Complete these topics first:
- Git init Command
- Git New Files
- Git Staging Environment
- Git clone Command
- Git status Command
- Git help Command
- Git add Command
- Git commit Command
- Git tags Command
- Git stash Command
- Git log Command
- Git diff Command
- Git show Command
- Git rm Command
- Git mv Command
- Git restore Command
- Git clean Command
- Git ignore (.gitignore)