gitloggingstatisticsbranchstat

Git log --stat summary of branch


I would like to show how many changes (insertions+deletions) I made on a feature branch. Is there a way to get a summary of the git log --stat output for the changes between 2 commits (branch root / tip).


Solution

  • for a feature branch you want to use

    git diff --stat dev..feature
    

    this relies on not doing back merges. See my post here: http://dymitruk.com/blog/2012/02/05/branch-per-feature/

    --stat can take parameters. This is useful if you have a wider terminal. You can do --stat=200 to say that your display can accommodate 200 columns.

    If you want to use this in a script, use --numstat instead. It will not truncate paths.