Counting commits with Git

Adam K Dean - Feb 10 '14 - - Dev Community

To count commits on a branch, you can use git rev-list.

For the branch you're on, use:

git rev-list --count HEAD
5
Enter fullscreen mode Exit fullscreen mode

Or for another <branch>, use:

git rev-list --count <branch>
5
Enter fullscreen mode Exit fullscreen mode

Also, to count commits by author, you can use git shortlog:

git shortlog -s -n
4 Some User
1 Joe Bloggs
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player