Category: Git

Number of commits in git

I have been working on a project that required me to work out the number of commits in a git repository. I thought github would show that in their display, but could find no such statistic once you get over a certain number. The only number I could find that indicated it was over 1000.

Git commit count on github

Searching around, there are a few solutions including most recently:

git rev-list HEAD --count

or

git shortlog | grep -E '^[ ]+\w+' | wc -l