Selecting and formatting the git log output

Now that you know how to select revisions to examine and to limit which revisions are shown (selecting those that are interesting), it is time to see how to select which part of information associated with the queried revisions to show, and how to format this output. There is a huge number and variety of options of the git log command available for this.

Predefined and user defined output formats

A very useful git log option is --pretty. This option changes the format of log output. There are a few prebuilt formats available for you to use. The oneline format prints each commit on a single line, which is useful if you're looking at a lot of commits; there exists --oneline, shorthand for --pretty=oneline ...

Get Git: Mastering Version Control 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.