Checking Status
The git status command shows the current state of your working directory and staging area.
Understanding Status Output
Status Categories
Git files can be in several states:
Untracked Files
New files that Git doesn't know about yet.
Untracked files:
newfile.txt
Staged Changes
Files added to the staging area, ready to commit.
Changes to be committed:
new file: feature.js
Modified Files
Tracked files that have been changed but not staged.
Changes not staged for commit:
modified: app.js
Clean Working Directory
nothing to commit, working tree clean
Status Flags
| Flag | Meaning |
|---|---|
-s | Short format |
-b | Show branch info |
--porcelain | Machine-readable |
Short Format
git status -s
Output codes:
??- UntrackedA- Added (staged)M- Modified (not staged)M- Modified (staged)MM- Modified (both staged and unstaged)
The Git Workflow
Working Directory → Staging Area → Repository
| | |
git add → git commit → history
Exercise: Check Status
Run git status to see the current repository state:

