I'm trying to get the total number of commits on a git repository, but the numbers seem wrong.
My first thought was to use:
git log --pretty=oneline | wc -l
Doing some research, I found a method that seems more appropriate for the task:
git rev-list --all --count
The thing is, even though they seem to accomplish the same thing, I'm getting different results. On a sample repository, the log
command returns 1039 commits, whilst rev-list
returns 1044 commits.
Why am I getting different results?