'git diff' 没有附加参数的结果?

Result of 'git diff' without additional parameters?

我使用 git diff master --name-only 检查了更改文件的名称,并收到了类似于以下内容的更改结果:

really/long/path/to/file.java
really/long/path/to/fileNumber2.java    
really/long/path/to/fileNumber3.java
really/long/path/to/fileNumber4.java

在此之后,我 运行 git diff 没有任何额外的参数,并且在代码库中得到了一大堆不是来自那些文件的更改。我的问题是,一个简单的 git diff 做了什么比较?

我的猜测是:它显示了最新和以前提交之间的差异,但是 man git-diff 和一些阅读并没有让我更清楚。

正如 the documentation 所解释的那样,仅调用 git diff 而不指定任何修订将向您显示相对于索引的更改,即出现在 “更改”中的所有未决更改当 运行 git status.

时未提交提交” 列表

git diff [--options] [--] [<path>…​]

This form is to view the changes you made relative to the index (staging area for the next commit). In other words, the differences are what you could tell Git to further add to the index but you still haven’t. You can stage these changes by using git-add[1].