Git log --stat summary of branch

opatut picture opatut · Nov 1, 2012 · Viewed 10.9k times · Source

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).

Thanks.

Answer

Adam Dymitruk picture Adam Dymitruk · Nov 1, 2012

for a feature branch you wand 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.