Git · Junior · Question 8 of 75
How do you see what is staged for the next commit?
- 1
git diff --all - 2
git log --staged - ✓Correct answer:
git diff --staged
Explanation
--staged (or its synonym --cached) compares the index with the last commit. It's worth checking before committing to make sure nothing extra is included.