git log自某个日期以来没有列出提交

时间:2016-02-21 02:45:37

标签: git date git-log

我刚刚使用git fast-import将大量的源历史从MKS迁移到git存储库。问题是,当我使用“git log”查看过去10天内存储库中的所有提交时,某些提交未列出,但应该如此。这就是我正在做的重现这个问题:

当我输入此命令以按作者“renato”列出3次提交时:

git log --pretty=format:"%h %an %ad" --author renato -3

我得到以下输出:

8cd40f6 renatoo Mon Feb 15 10:35:28 2016 -0600
a2694d2 renatoo Fri Feb 5 13:30:14 2016 -0600
57ee8d3 renatoo Thu Jan 14 15:08:33 2016 -0600

请注意,第一个日期是2016年2月15日,即5天前。

但是,如果我发出以下命令列出过去10天内的所有提交,则不会显示任何内容:

git log --pretty=format:"%h %an %ad" --author renato --since=10.days

我实际上已经玩过这一点了,我发现我可以为“--since”发出的最终显示他的提交的价值是24年!:

>git log --pretty=format:"%h %an %ad" --author renato --since=24.years
8cd40f6 renatoo Mon Feb 15 10:35:28 2016 -0600
a2694d2 renatoo Fri Feb 5 13:30:14 2016 -0600
57ee8d3 renatoo Thu Jan 14 15:08:33 2016 -0600
aa0d926 renatoo Thu Jan 14 15:08:08 2016 -0600
13fdca1 renatoo Thu Jan 14 15:08:22 2016 -0600
32c5af7 renatoo Wed Jan 20 08:59:56 2016 -0600
68231db renatoo Thu Jan 14 15:18:55 2016 -0600
2c25c72 renatoo Thu Jan 14 15:17:28 2016 -0600
1d7ddd3 renatoo Thu Jan 14 15:18:08 2016 -0600
9677ed9 renatoo Thu Jan 14 15:16:51 2016 -0600
1da4267 renatoo Thu Jan 14 15:14:39 2016 -0600
c64b3e1 renatoo Thu Jan 14 15:14:03 2016 -0600
ea9fe12 renatoo Thu Jan 14 15:10:10 2016 -0600
708b712 renatoo Thu Jan 14 15:12:27 2016 -0600
b24a2cf renatoo Thu Jan 14 15:13:12 2016 -0600
15c5abe renatoo Fri Jan 29 15:32:53 2016 -0600
a698bbe renatoo Mon Feb 15 10:36:51 2016 -0600
861b322 renatoo Fri Feb 5 13:29:37 2016 -0600
3da4bcf renatoo Fri Jan 29 15:32:17 2016 -0600
3a1db85 renatoo Fri Jan 29 15:32:14 2016 -0600
d60841f renatoo Mon Feb 15 10:36:17 2016 -0600
132d762 renatoo Fri Feb 5 13:28:49 2016 -0600
764d6e0 renatoo Mon Feb 15 10:36:23 2016 -0600
9d35f44 renatoo Fri Feb 5 13:29:10 2016 -0600
f808b8b renatoo Mon Feb 15 10:36:09 2016 -0600
2b04034 renatoo Fri Feb 5 13:28:37 2016 -0600
682a776 renatoo Mon Jan 25 11:46:30 2016 -0600
1276d4b renatoo Fri Jan 22 10:42:39 2016 -0600
ad77333 renatoo Mon Jan 25 11:47:09 2016 -0600
2df0aec renatoo Fri Jan 22 10:42:25 2016 -0600
>

但是23年不起作用:

>git log --pretty=format:"%h %an %ad" --author renato --since=23.years
>

我尝试了很多不同的东西,包括查看提交者日期和作者日期(在这种情况下它们都匹配这些提交),以及尝试选项--all, - branchs和--reflogs。

是否有一种不同且更可靠的方式来在给定的时间内获得所有提交(我个人对过去3天内提交的内容感兴趣)? 回购公司会有一些腐败吗?

编辑:修复了最后一个示例命令行。

1 个答案:

答案 0 :(得分:0)

在你的情况下答案很简单:

git log --since=10.days 

以下是您可以使用的其他一些示例。

--after--before

# You can also pass in relative references 
# like "1 week ago" and "yesterday":    
git log --after="2014-7-1"
get log --after="yesterday"

--since and --until

--since--until标记分别与--after--before同义。

更多样本:

git log --before <date>
git log --after <date>
git log --after 2.days.ago
git log --after <date> --before <date>
相关问题