我在一个git仓库中,其中做了一些更改。所以我首先运行了git status
命令,它显示有一个文件已更改。然后我运行了git diff
命令来查看更改情况,但是它没有输出任何内容(请参见下面的输出),甚至没有模式更改或其他任何东西。
有人知道为什么git diff
命令在明显有更改的情况下不输出任何内容吗?欢迎提供所有提示!
$ git status
On branch master
Your branch is up-to-date with 'origin/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: src/app/models/VariablePosition.py
no changes added to commit (use "git add" and/or "git commit -a")
$ git diff
$
[编辑]
有人问了git config core.filemode
的输出结果:
$ git config core.filemode
true
$ git diff
命令会显示工作目录和索引之间的差异。 - Thomas Stringergit
? - Arkadiusz Drabczykcore.filemode
设置为false
,git diff
就不会显示仅有权限更改的文件的更改。 - jub0bs