To get the commit count for all authors, including commits across all branches in a Git repository

Posted: 21-10-2023 | Views: 89
To get the commit count for all authors, including commits across all branches in a Git repository

To get the commit count for all authors, including commits across all branches in a Git repository, you can use the following command:

git shortlog -s -n --all

Here's what each part of this command does:

  • git shortlog: This command generates a summary of Git logs.

  • -s: This option shows a summary count of commits by each author.

  • -n: This option sorts the output by the number of commits in descending order, so you'll see authors with the most commits at the top.

  • --all: This option includes all branches in the count.

When you run this command, you'll get a list of authors along with the number of commits they've made across all branches in the repository.

Add comment