I'm writing a small script and want to know how many commits I made on a current branch since it was created.

In this example I'd have 2 commits made on child:

git checkout master
git checkout -b child
...
git commit -a
...
git commit -a

So what I want is

commit_number = ...
echo $commit_number
Edit
Report