Using `git diff HEAD` to show All Changes
You probably know:
git diffshows unstaged changes.git diff --cachedshows staged changes.
But how do you see all changes in one go? Just use:
git diff HEAD
Here's the breakdown:
git diffcompares the working directory to the staged index. If nothing is staged, it's the same asgit diff HEAD.git diff --cachedcompares 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.