在暂存区中的文件上显示 git diff

git add file
git diff file

答案

$ git diff --cached
$ git diff --staged
git diff --staged
git diff --cached

您还可以使用git diff HEAD file来显示特定文件的差异。

参见git-diff(1)下的EXAMPLE部分