How to run a diff on unstagged changes?

Written by Mandeep Singh in Solving Mistories

git diff --staged

Git won't do a diff of files that have been add-ed 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!)

Sign up below to receive updates, tips and more handy tutorials when git screws up. It’s good stuff & I don’t spam.