6.2 Specifying Revision Ranges

I have what I’ve come to call a “nonhistorian” brain. Specifics take a lot of work for me to remember. I know the gist of American history, but I can’t tell you specific dates unless they ended up spawning a national holiday.

The same thing happens when I code: “I added that functionality last Monday or Tuesday.” “I fixed that bug this morning.” Git has a lot of functionality for looking through its logs that way.

Git provides some other useful ways for filtering the commits that you see. Say you want to look at commits only from the last five hours, so you add --since="5 hours".

Your command now looks like this:

 
​prompt> git log --since="5 hours"
 
​commit 0bb3dfb752fa3c890ffc781fd6bd5dc5d34cd3be​ ...

Get Pragmatic Version Control Using Git now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.