列表git提交两个日期之间的主分支

问题描述 投票:24回答:4

如何获取2014-01-01和2014-06-30之间对主分支所做的所有git提交的列表?

我知道git log会给我大致这种格式(对所有提交都重复):

commit <hash>
author: <author name>
date: <date>
<comment>

但是如何将其限制为选定日期和每个提交格式一行?

<hash> <author> <date>
<hash> <author> <date>
git git-log
4个回答
37
投票
$ git log --since "DEC 1 2014" --until "DEC 5 2014" --pretty=format:"%h %an %ad"

这将为您提供2014年12月1日至2014年12月5日期间提交的格式,您可以根据需要更改日期

如果你想改变格式,你可以read about the options here


6
投票
$ git log master --pretty="%h %an %ad" --since=2014-01-01 --until=2014-06-30

这是一切http://git-scm.com/docs/git-log


4
投票

你有没有尝试过

git whatchanged --since="2 year ago" --until="1 year ago" [--author="NAME_OF_THE_AUTHOR"]

即使是git log也可以用来获得这个结果。 git log有一些提前选择

git log --after="2014-7-1" --before="2014-7-4"

有关高级git日志的更多详细信息,请参阅此link


2
投票

好吧,这应该是诀窍:

git log --oneline since="1/1/2014" --until="30/6/2014"
© www.soinside.com 2019 - 2024. All rights reserved.