Git

Git: git diff --staged — Linux

Review changes staged for the next commit.

Availability: Tool and version dependent; install separately where required.中文

Syntax

git diff --staged

Examples

Review changes staged for the next commit.

git diff --staged

Parameters, options and clauses

Option / clauseDescription
--staged / --cachedCompare staged changes with the index base.
--statShow a summary of changed files.
--name-onlyPrint only changed file names.
-- <path>Limit the diff to a path.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory