How to Use git status to Check Your Repository
Short answer
The git status command shows the current state of your working directory and staging area. It reports which branch you are on, whether your branch is ahead of or behind its remote counterpart, which changes are staged for the next commit, which tracked files have unstaged modifications, which files are untracked (new and not yet added to Git), and whether any files are in a conflict state after a failed merge. Run git status with no arguments for the full output, or use git status -s -b for a compact short format that still includes branch tracking information.
git status shows the current state of your working copy — which files have changed, which are staged for the next commit, and whether your branch is in sync with its remote counterpart. It's one of the most frequently used Git commands and safe to run at any time.
The Git Cheat Sheet
No need to remember all those commands and parameters: get our popular "Git Cheat Sheet" - for free!
Free. We email you a ZIP with our cheat sheets.
Reading the Output
Run git status with no arguments:
git status
On branch feature/login
Your branch is ahead of 'origin/feature/login' by 1 commit.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: error.html
new file: img/icon.png
Unmerged paths:
(use "git restore --staged <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: index.html
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: imprint.html
Untracked files:
(use "git add <file>..." to include in what will be committed)
products.html
Here's what each section means:
- "On branch..." — the branch you currently have checked out.
- "Your branch is..." — sync state with the remote: "ahead" means unpushed commits, "behind" means unpulled commits.
- "Changes to be committed" — modifications already staged with
git add, ready for the next commit. - "Unmerged paths" — files in a conflict state that need to be resolved before committing.
- "Changes not staged for commit" — modified tracked files not yet staged.
- "Untracked files" — new files Git is not yet tracking.
Compact Output
For a shorter format that still includes branch tracking info, use -s -b:
git status -s -b
## feature/login...origin/feature/login [ahead 1]
D error.html
A img/icon.png
M imprint.html
UU index.html
?? products.html
No Command Line Needed
Working Copy Status in Tower
In case you are using the Tower Git client, your working copy status is always right in front of you: select any modified file to see its changes in detail and simply stage it with a click!