447

I'd like to get the number of commits per author on all branches. I see that

git shortlog -s -n

Prints a very nice list but it is not counting the commits that are not yet merged from other branches. If iterate this command over every branch then obviously the common commits get counted multiple times. Could you give me a script/command that would yield me the overall picture?

jabal
  • 11,987
  • 12
  • 51
  • 99
  • 1
    Any way to include users who did not make commits? Show them as 0? – niken Oct 16 '17 at 15:08
  • 27
    The problem is every programmer in the universe excluding the actual committers are potentially users with zero commit in your repo. So the list would be too long. – jabal Dec 07 '17 at 20:26

1 Answers1

899
git shortlog --summary --numbered --all --no-merges

Will give you statistics for all branches.

EDIT: Added --no-merges to exclude statistics from merge commits.

Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
rtn
  • 127,556
  • 20
  • 111
  • 121