如何获取在 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日之间的提交提供所需的格式,您可以根据需要更改日期
如果您想更改格式,可以在此处阅读有关选项的信息
$ git log master --pretty="%h %an %ad" --since=2014-01-01 --until=2014-06-30
这是一切 http://git-scm.com/docs/git-log
你试过吗
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 日志的更多详细信息,您可以参考此链接
好吧,这应该可以解决问题:
git log --oneline --since="1/1/2014" --until="30/6/2014"
<小时 />