Intermediate
Git & Version Control
Q68 / 100
What is the purpose of "git diff --staged" (or "--cached")?
Correct! Well done.
Incorrect.
The correct answer is A) It shows the differences between the staging area (index) and the last commit (HEAD), i.e. what would be included if you ran "git commit" right now
A
Correct Answer
It shows the differences between the staging area (index) and the last commit (HEAD), i.e. what would be included if you ran "git commit" right now
Explanation
Plain "git diff" shows unstaged changes (working directory vs. index), while "git diff --staged" shows staged changes (index vs. HEAD) — useful for reviewing exactly what will be committed.
Progress
68/100