为什么git diff
认为没有更改,即使git status
报告了更改为modified?
$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: file-added
modified: file-with-changes << it knows there are changes
但是为了看到差异,我需要明确地添加最后一个版本哈希值。
$ git diff
(nothing)
$ git diff rev-hash
diff --git a/file-with-changes b/file-with-changes
index d251979..a5fff1c 100644
--- a/file-with-changes
+++ b/file-with-changes
.
..