Git没有显示修改文件的差异

时间:2013-11-26 17:06:29

标签: git diff

有一个文件,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的差异?

1 个答案:

答案 0 :(得分:2)

这是因为Main.pm的唯一更改是文件权限。文件内容没有差异。