如何获取2014-01-01和2014-06-30之间对主分支所做的所有git提交的列表?
我知道git log
会给我大致这种格式(对所有提交都重复):
commit <hash>
author: <author name>
date: <date>
<comment>
但是如何将其限制为选定日期和每个提交格式一行?
<hash> <author> <date>
<hash> <author> <date>
$ 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
$ git log master --pretty="%h %an %ad" --since=2014-01-01 --until=2014-06-30
你有没有尝试过
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
好吧,这应该是诀窍:
git log --oneline since="1/1/2014" --until="30/6/2014"