git status and git diff explained

git status lists which files are modified, staged or new, and whether your branch is ahead of or behind GitHub. git diff shows the exact lines you changed: - for removed, + for added.

Step by step

  1. What changed?

    $ git status
  2. Which lines, exactly (not yet staged)?

    $ git diff
  3. What will the next commit contain?

    $ git diff --staged

Neither command changes anything, so run them as often as you like. Most git confusion goes away by running git status first.

Try it in the interactive sandbox →Practice “Ask git what changed” with a real repository and teammates, right in your browser.

Related guides