Using `git diff HEAD` to show All Changes
You probably know:
git diff
shows unstaged changes.git diff --cached
shows staged changes.
But how do you see all changes in one go? Just use:
git diff HEAD
Here's the breakdown:
git diff
compares the working directory to the staged index. If nothing is staged, it's the same asgit diff HEAD
.git diff --cached
compares the staged index to HEAD. It's a shortcut forgit diff --cached HEAD
.git diff HEAD
(orgit diff <commit/branch/tag>
) compares your current working directory with the specified commit.