30 Viewing the Log

Git’s bread and butter is tracking changes to files in your project over a period of time. You use the log to view that history.

You can use git log to view the standard log output. Git displays the commit ID, author, date, and commit message for each commit in reverse chronological order. Git sends the output through less to keep the output from scrolling past on the screen too fast to be seen.

You can use the --oneline parameter to shorten the log display to show the first seven characters of the commit ID and the subject of the log message. It increases the number of commits you can view on one screen and with properly written log messages makes scanning easier.

Viewing the entire history often gives you too ...

Get Pragmatic Guide to 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.