How to run a diff on unstaged changes in git?

Doing a diff is very simple and easy, just remember the following command, and you are set for life.

git diff --staged

Git won't do a diff of files that have been added to your staging area without this flag. File under ¯(ツ)/¯ (yes, this is a feature, not a bug, but it's baffling and non-obvious the first time it happens to you!)

Originally Posted On: OhShitGit

Subscribe to GIT.WTF!?!

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe