git – How to retrieve the number of commits made by a person?

Question:

What is the Git command to retrieve the number of commits made by a certain programmer?

Answer:

Just one command is enough to get the total result of commits from all authors:

git shortlog -n -s

Exit:

9  paulomartinhago
1  Lucas Miguel

Another way to get a result, now by author:

git shortlog -n --author=paulomartinhago

Exit:

paulomartinhago (9):
      Demo commit 9
      Demo commit 8
      Demo commit 7
      Demo commit 6
      Demo commit 5
      Demo commit 4
      Demo commit 3
      Demo commit 2
      Demo commit 1

Or as follows, without listing the commits:

git shortlog -n -s --author=paulomartinhago

Exit:

9  paulomartinhago
Scroll to Top