What is the difference between `git log` and `git status`?
In short
git log and git status answer different questions:
git log→ what happened beforegit status→ what is happening now
git log - commit history
The git log command shows:
- commits that are already saved
- the project's change history
- who made each commit, when, and with what message
Important:
git logonly works with commits- it does not show uncommitted changes
The repository's past.
git status - current state
The git status command shows:
- changed files that are not yet committed
- which files are added to the staging area
- which files are untracked
- which branch you are on
The repository's current working state.
Side-by-side comparison
| Command | What it shows | About |
|---|---|---|
git log | Commits | The past |
git status | Files | The present |
A typical real-life situation
You wrote some code and think:
- "What have I already committed?" →
git log - "What is changed now and ready to commit?" →
git status
An important point for an interview
git status never changes history, it only shows the state.
git log also changes nothing, it only reads history.
Both commands are safe (read-only).
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.