I found this answer already: Number of commits on branch in git but that assumes that the branch was created from master.
How can I count the number of commits along
You can also do git log | grep commit | wc -l
and get the result back