有一个文件,git st
获取:
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: lib/ABC/Main.pm
#
no changes added to commit (use "git add" and/or "git commit -a")
git diff
得到:
diff --git a/lib/ABC/Main.pm b/lib/ABC/Main.pm
old mode 100755 new
mode 100644
git diff HEAD
也是一样。
添加文件后,git diff
不显示任何内容。
git diff HEAD
得到:
diff --git a/lib/ABC/Main.pm b/lib/ABC/Main.pm
old mode 100755
new mode 100644
如何恰当地展示与git diff的差异?
答案 0 :(得分:2)
这是因为Main.pm
的唯一更改是文件权限。文件内容没有差异。