查看git中分阶段更改的差异

可能重复:
我如何显示已经上演的变化?

有没有简单的方法来查看我在git中挂起的阶段性更改的差异? 我已经上传了几个文件,但想要在按下按钮之前最后看一下我正在提交的内容。 我还有其他几个未分离的更改,我想单独提交,因此暂停,执行git diff ,然后分页到我想要的文件并非所有这些都是合意的选项。

例:

$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   foo.java
#
# Changed but not updated:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   bar.java
#       modified:   baz.java
#       modified:   qux.java

我真的只想看看我在foo.java更改了什么,而不需要foo.java


再过一分钟Google就找到了答案,回答我自己的问题:

git diff --cached
链接地址: http://www.djcxy.com/p/50863.html

上一篇: View diff of staged changes in git

下一篇: Deleting a badly named git branch