Skills › 💻 Terminal & git

See exactly what you're about to commit

Plain git diff hides anything you've already staged. Add one flag to see what the commit will contain.

⏱ 20s

  1. Stage some changes with git add.
  2. Run git diff --staged to see what will be committed.
  3. Run plain git diff to see what's changed but not staged yet.
  4. Run git diff HEAD to see both together.

Tip: --cached does exactly the same thing as --staged; you'll see both in other people's notes.

Try it now: In any repo, edit a file, git add it, and compare git diff (empty) with git diff --staged.

Practice in the feed →

Next crumbs

Sources