O'Reilly logo

Pragmatic Version Control Using Git by Travis Swicegood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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
 
Author: Travis ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required