Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git count filtered commits

Is it possible to get a number of git commits filtered by commit-message?

$ git log --all --grep='SEARCH_STRING'  

With this snippet I get a list of all commits with the searched string. But I got a lot of commits and its hard to count this by Hand.

Is there a way git tells me the sum of the commits in this list?

like image 336
chrisheyn Avatar asked Dec 06 '25 04:12

chrisheyn


1 Answers

I think I found it

$ git rev-list --all --grep='SEARCH_STRING' --count

Thanks to @Inian for the tip with --count.

like image 115
chrisheyn Avatar answered Dec 07 '25 18:12

chrisheyn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!