A 5 month project of mine is nearing its end and as a fan of pointless statistics,
I'd like to know how many commits have been made since the repository's inception.
How do I find that out?
Notes:
I know there is no one repository, I'm just interested in the local version.
This is trivial in subversion, as the revision identifier seems to be the commit number.
On GitHub, you can see the commit history of a repository by: Navigating directly to the commits page of a repository. Clicking on a file, then clicking History, to get to the commit history for a specific file.
1 accepted. Hi @Diliup-G , We don't have a limit on the number of commits per repository.
To get the number of commits on the current branch:
git log --pretty=oneline | wc -l
For a more complete count, use:
git rev-list --all | wc -l
See the docmentation for git rev-list for details on specifying objects to count.
It is tempting to try something like:
find .git/objects -type f | wc -l
but this will not count packed objects. It's best to stick with git rev-list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With