A1.4 History

These commands show you your history, including where your code has been, who did what and when, changes, and statistics. Many of these commands are detailed in Chapter 6, Working with Git’s History.

Show All History

 
​prompt> git log

Display Log with Patch Showing Change

 
​prompt> git log -p

Limit Log to Show One Entry

 
​prompt> git log -1

Limit Log to Show Twenty Entries and Patches

 
​prompt> git log -20 -p

Show Commits from Past Six Hours

 
​prompt> git log --since="6 hours"

Show Commits Older Than Two Days

 
​prompt> git log --before="2 days"

Show Log for Single Commit Three Commits Prior to HEAD

 
​prompt> git log -1 HEAD~3

Or...

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.