Ijaz Khan Ijaz Khan - 22 days ago 9
Git Question

Get number of commits per author on all branches of Git repo

I used

git shortlog -sn --all
to get a list of all authors with their commits for all the branches.

The problem is , i just want the list of authors that have been contributing since last year , ignoring the others. Is there any way to include a time range in this? Because from the help page i don't see anything like that.

The git-hub also provides this through API call but that just returns the top 100 contributors, not all of them.

Thanks

Answer

You can use the since argument for this.

git shortlog -sn --all --since=1.year

It has relative times but you can also use dates:

git shortlog -sn --all --since={2016-01-01}

Or a range:

git shortlog -sn --all --after={2013-04-01} --before={2014-01-01}