nickcoxdotme nickcoxdotme - 5 months ago 43
Git Question

How can I count number of commits between two branches?

Using the

git diff --shortstat my_branch master
is a great way to tell how many files changes and the insertions and deletions. I read the git diff documentation, but I couldn't find a way to tell the number of commits between
. Does that exist?


I think you could try:

git log --oneline mybranch ^master

For the exact count:

git log --oneline mybranch ^master | wc -l

Should give you the information you want.