How to do it...

We want to start by listing some stats for one commit, and then we can extend the examples to larger chunks of commits:

  1. The first option we will be using is --dirstat for git log as follows:
$ git log -1 --dirstat 
commit da6e87bc373c54c1cda8ed563f41f65df52bacbf 
Author: Matthias Sohn <> 
Date:   Thu Oct 3 17:22:08 2013 +0200 
    Prepare post 3.1.0 builds 
    Change-Id: I306a3d40c6ddb88a16d17f09a60e3d19b0716962 
    Signed-off-by: Matthias Sohn <> 
   5.0% org.eclipse.jgit.http.server/META-INF/ 
   6.9% org.eclipse.jgit.http.test/META-INF/ 
   3.3% org.eclipse.jgit.java7.test/META-INF/ 
   4.3% org.eclipse.jgit.junit.http/META-INF/ 
   6.6% org.eclipse.jgit.junit/META-INF/ 
   5.5% org.eclipse.jgit.packaging/ 

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.