opatut
opatut

Reputation: 6864

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

Upvotes: 18

Views: 15619

Answers (2)

Adam Dymitruk
Adam Dymitruk

Reputation: 129782

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.

Upvotes: 23

interskh
interskh

Reputation: 2591

use git diff

git diff --stat <branch root> HEAD

Upvotes: 8

Related Questions