Show git diff on file in staging area [duplicate] Show git diff on file in staging area [duplicate] git git

Show git diff on file in staging area [duplicate]


You can show changes that have been staged with the --cached flag:

$ git diff --cached

In more recent versions of git, you can also use the --staged flag (--staged is a synonym for --cached):

$ git diff --staged


In order to see the changes that have been staged already, you can pass the -–staged option to git diff (in pre-1.6 versions of Git, use –-cached).

git diff --stagedgit diff --cached


You can also use git diff HEAD file to show the diff for a specific file.

See the EXAMPLE section under git-diff(1)