FahamLah

Commands

git diff

git diff [--staged] [a] [b]

Risk: Safe

What it does

Shows the changed lines. Red removed, green added.

When to use it

Before you add or commit.

Example

$ git diff

Changes not in the box yet.

$ git diff --staged

Changes in the box.

$ git diff HEAD~2 HEAD

Between two commits.