is there a way to count the number of commits in certain period (e.g. the last year from 2015-03-01 to 2016-03-01) for git (GitHub) repositories?
Show activity on this post. This gives me an exact count of commits in the current branch having its base on master. The command in Peter's answer, git rev-list --count HEAD ^develop includes many more commits, 678 vs 97 on my current project.
The git shortlog command is a special version of git log intended for creating release announcements. It groups each commit by author and displays the first line of each commit message. This is an easy way to see who's been working on what.
It's possible to use the Awesome Graphs app which is free and visualizes the number of commits added by each developer. This Bitbucket REST API query returns the list of commits in a repo so that it's possible to count their number. Hope it helps!
To count the commits in a date range in your current branch do this:
git rev-list --count HEAD --since="Dec 3 2015" --before="Jan 3 2016"
If you want the count for all branches in one go use --all additionally
git rev-list --count --since="Dec 3 2015" --before="Jan 3 2016" --all
if you want to exclude merge-commits, use option --no-merges
git rev-list --count --since="Dec 3 2015" --before="Jan 3 2016" --all --no-merges
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With