Command

git diff

For ordinary comparisons, shows working tree against index, index against HEAD with --cached, or tracked working contents against HEAD with HEAD. Untracked files are not included. HEAD form requires a commit.

Formal Syntax & Structure

git syntaxgit
git diff [--cached | HEAD] [--] [<path>...]

Working Example

Example Snippetgit
git diff --cached -- notes.txt
Git Reference