【发布时间】:2017-05-05 20:32:10
【问题描述】:
有没有办法查看同一文件的staged 和unstaged 版本之间的差异?
例如:
Changes to be committed:
modified: conf/application.conf
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: conf/application.conf
当我暂存更改然后再次修改文件而不暂存它时会发生这种情况。
EDIT
git status -vv 命令不够好,因为我需要使用diff / difftool 命令。那是因为实际上在太多文件中有太多更改,并且滚动浏览所有文件效率不高。但是diff/difftool允许我指定我感兴趣的文件。
【问题讨论】:
-
是同一个文件。
-
@MarounMaroun 是的,这就是重点。 Git 专注于对文件的更改,而不是文件本身。看到这个问题:stackoverflow.com/questions/24837841/…
标签: git diff git-diff difftool git-stage