git diff:如何仅查看暂存/缓存/索引的差异?

git diff:如何仅查看暂存/缓存/索引的差异?,git,git-diff,Git,Git Diff,我只想看到使用git diff的索引更改的上下文差异 以下是我看到的: C:\GitProject\DiffTestProject [master +0 ~1 -0]> git diff diff --git a/a.txt b/a.txt index 07d4aba..e9944e6 100644 Binary files a/a.txt and b/a.txt differ git diff filename查看未提交的更改 git diff-cached查看索引和上次提交之间的差异。 请尝

我只想看到使用git diff的索引更改的上下文差异

以下是我看到的:

C:\GitProject\DiffTestProject [master +0 ~1 -0]> git diff diff --git a/a.txt b/a.txt index 07d4aba..e9944e6 100644 Binary files a/a.txt and b/a.txt differ git diff filename查看未提交的更改 git diff-cached查看索引和上次提交之间的差异。
请尝试使用diff-a强制将所有文件作为文本文件进行检查。@tripleee它可以在my.txt中运行。非常感谢,您解释了我的疑问:johnMa谢谢您的回复。我正在尝试此命令,但这不是我想要的结果,谢谢: