← TechnologyThe essentials of

Git diff: choose the two sides first

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 16:11 · Updated: 22 Oct 2026 16:11

AI source check: 22 Oct 2026 14:04. This is not editorial approval.

In a few sentences

In brief

Plain git diff shows unstaged changes against the index. git diff --cached shows staged changes against a commit, normally HEAD.

Useful to know

Plain git diff shows unstaged changes against the index. git diff --cached shows staged changes against a commit, normally HEAD. [1]

An empty plain diff therefore does not prove there is nothing to commit. Establish whether the review concerns working files, the index or two historical versions. Otherwise, the right file may be reviewed while different contents are actually recorded.

Sources

For further detail and to check the information:

  1. [1] Git - git-diff Documentation ↗