List git commits to master branch between two dates

Aksel Willgert picture Aksel Willgert · Dec 5, 2014 · Viewed 25.6k times · Source

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>

Answer

Tim picture Tim · Dec 5, 2014
$ 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 read about the options here