Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git number of commits per author on all branches

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?

like image 661
jabal Avatar asked Mar 23 '12 12:03

jabal


People also ask

How do you find the number of commits per author?

To get the number of commits for each user execute git shortlog -sn --all. To get the number of lines added and delete by a specific user install q and then execute: git log --author="authorsname" --format=tformat: --numstat | q -t "select sum(c1), sum(c2) from -"

How can I see all branch commits?

On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.


1 Answers

git shortlog -s -n --all --no-merges 

Will give you statistics for all branches.

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

like image 71
ralphtheninja Avatar answered Sep 19 '22 13:09

ralphtheninja