DrK*_*liN 11 git diff git-diff difftool git-stage
有没有办法查看同一文件的版本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
Run Code Online (Sandbox Code Playgroud)
当我进行更改然后再次修改文件而不进行暂存时会发生这种情况.
EDIT
该git status -vv
命令还不够好,因为我需要使用diff
/ difftool
命令.这是因为在实践中,太多文件中的更改太多,滚动浏览所有文件并不高效.但diff
/ difftool
允许我指定我感兴趣的文件.
Ran*_*ght 28
git diff
将显示工作区和索引之间的差异.(索引是暂存文件的位置)
这似乎并不明显,因为我们通常git diff
用来查看工作区中的更改与签入的内容.但是,技术上git diff
显示工作区与索引,如果您尚未向索引添加更改,则索引与您签出的内容相匹配.
git diff HEAD
git diff --cached
也可以使用--staged)git diff
归档时间: |
|
查看次数: |
7293 次 |
最近记录: |