nickcoxdotme nickcoxdotme - 1 year ago 87
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download