【问题标题】:git diff: how to see only staged/cached/indexed differences?git diff:如何仅查看暂存/缓存/索引差异?
【发布时间】:2013-12-25 13:38:21
【问题描述】:

我只想查看带有 git diff 的索引更改的上下文差异。

这是我所看到的:

C:\GitProject\DiffTestProject [master +0 ~1 -0]> git diff
差异 --git a/a.txt b/a.txt
索引 07d4aba..e9944e6 100644
二进制文件 a/a.txt 和 b/a.txt 不同

【问题讨论】:

  • 尝试diff -a 强制将所有文件作为文本文件进行检查。
  • @tripleee 它可以在我的 .txt 中运行。非常感谢,你解释了我的疑惑:)

标签: git git-diff


【解决方案1】:
git diff filename # see uncommitted changes
git diff --cached # see the difference between index and last commit.

【讨论】:

  • johnMa 谢谢你的回复。我正在尝试这个命令,但这不是我想要的结果,谢谢:)
猜你喜欢
  • 2015-06-01
  • 1970-01-01
  • 1970-01-01
  • 2010-09-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多