Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Count Git commits per period

Tags:

git

github

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?

like image 707
Kody Avatar asked Mar 18 '16 08:03

Kody


People also ask

How can I see how many commits I have in git?

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.

What is git Shortlog?

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.

How do I count the number of commits in bitbucket?

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!


1 Answers

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 
like image 195
Shripada Avatar answered Oct 08 '22 02:10

Shripada