33 Generating Statistics About Changes

The individual commit’s changes are important, but viewing those changes in aggregate through statistics can provide you with a unique view of the project. Git helps you do that through the various statistical outputs it generates.

Git’s git diff --stat is the most straightforward of the displays. It takes one or two commits—remember, git diff assumes HEAD as its second commit if you don’t specify it—and displays stats regarding the changes rather than displaying the diff output. It includes file-by-file changes in addition to the summary statistics. Git uses the diffstat command for this, so the output may look familiar if you’re used to that program.

Sometimes all you need is the final ...

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.