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

时间:2018-02-14 09:37:32

标签: git git-log

我遇到以下情况:

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更新。 / p>

我也遇到以下情况:

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行为还是我正在寻找某种东西?

1 个答案:

答案 0 :(得分:1)

git log .git log不同。

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