我如何获取2014年1月1日至2014年6月30日期间提交到主分支的所有git提交记录列表?
我知道git log
命令将大致给出以下格式(对于所有提交都会重复显示):
commit <hash>
author: <author name>
date: <date>
<comment>
但是如何将其限制在所选日期和每个提交一行的格式中?
<hash> <author> <date>
<hash> <author> <date>
我如何获取2014年1月1日至2014年6月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日至12月5日之间提交的内容,你可以根据需要更改日期。
如果您希望更改格式,您可以在此处阅读有关选项的信息。
> output
- emrcftci$ 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日志的详细信息,可以参考这个链接
好的,这应该能解决问题:
git log --oneline --since="1/1/2014" --until="30/6/2014"
since
更改为 --since
。 - Christian