Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (29.3k points)

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. I 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?

1 Answer

0 votes
by (50.2k points)

To get the data of authors on all branches you could use the following command:

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

This will give the data of all branches regarding several commits per author.

--no-merge  is used to exclude the data of merge commits.

For more information refer: 

Browse Categories