List git commits to master branch between two date

2019-01-22 19:57发布

How can i get a list of all the git commits done to the master branch between 2014-01-01 and 2014-06-30?

I know git log will give me roughly this format (repeated for all commits):

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

But how can it be limited to selected dates and a one line per commit format?

<hash> <author> <date>
<hash> <author> <date>

标签: git git-log
4条回答
Juvenile、少年°
2楼-- · 2019-01-22 20:17
$ git log --since "DEC 1 2014" --until "DEC 5 2014" --pretty=format:"%h %an %ad"

This will give the format you want for the commits between dec 1 2014 and dec 5 2014, you can change the dates as you like

If you wish to change the format, you can look at http://git-scm.com/docs/git-log under format:

查看更多
时光不老,我们不散
3楼-- · 2019-01-22 20:17

Well, this should do the trick:

git log --oneline since="1/1/2014" --until="30/6/2014"
查看更多
Explosion°爆炸
4楼-- · 2019-01-22 20:21
$ git log master --pretty="%h %an %ad" --since=2014-01-01 --until=2014-06-30

Here is everything http://git-scm.com/docs/git-log

查看更多
神经病院院长
5楼-- · 2019-01-22 20:29

Have you tried

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

Even git log can be utilized to have this result. There are some advance options available in git log

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

For more details about advance git log you can refer to this link

查看更多
登录 后发表回答