Retrieve a given period of logs from Git

 Mar 5, 2013

Just the other day I needed to find out if we were messing around with some code in our codebase at a certain date where a bug appears to have been introduced.

To start this process I wanted to grab a snapshot of just that weeks commits and work backwards from there

In case you haven’t come across it, here is the commands used to pull out a range of dates from the commit log

git log --since 2012/09/14 --until 2012/09/21 \
--oneline >> gitlog.txt

The --since and --until commands allow you to provide a date range which will be displayed.

--oneline is how I prefer to quickly parse the logs, and for those less familiar with the command line, the >> gitlog.txt streams the output from the git log command into a text file in the current directory instead of the terminal via STDOUT.