为什么 Git 不显示根目录中内部目录的最新日志?



我遇到以下情况:

user@host:~myproj$ git log . | head
commit 824982108230598203958209
Author: me <me@me>
Date:   Web Feb 14 00:17:13 2018+0100
My comment of commit B
commit 215237562352395782927652
Author: me <me@me>
Date:   Web Feb 13 00:05:21 2018+0100
My comment to last common commit C
user@host:~myproj$ git log inner/directory | head
commit 124975408286439738467394
Author: me <me@me>
Date:   Web Feb 14 10:08:35 2018+0100
Comment to a more recent commit A
commit 215237562352395782927652
Author: me <me@me>
Date:   Web Feb 13 00:05:21 2018+0100
My comment to last common commit C

也就是说,如果我从根目录运行git log,我会看到提交 B 和 C,如果我从内部目录运行git log,我会看到提交 A 和 C,A 比 B 更新。

我也处于以下情况:

user@host:~myproj$ git status
On branch master
Your branch is up-to-date with 'origin/master'
nothing to commit, working directory clean
user@host:~myproj$ git pull
Already up-to-date.
user@host:~myproj$ git push
Everything up-to-date

我以为从根目录询问日志会显示项目所有子目录中的每个提交;既然现在我发现我错了,我怎么能按提交日期获得提交历史顺序的完整列表?

另外,为什么会发生这种情况?这是正常的 git 行为还是我在做某事?

结果git log .git log不同。

我的问题可以通过简单地发布来回答:git log,而无需指定任何路径

最新更新