简体   繁体   中英

git commit count for each branch in date range

I am in a repository where there are many branches. I want to get commit count happening on each branch in a specific date range like in Month of September or October 2017 how many commits happened on that specific branch.

I used something like this :

git log --pretty=format:"%ad - %an: %s" --after="2017-12-01" --until="2017-12-31" | wc -l 

but this show for master. I cannot checkout the branches as i have cloned bare repository only. The primary purpose is to get a reporting tool only.

Can somebody help me in getting the solution. Thank You.

You can name any branch:

git log --oneline --after="2017-12-01" --before="2017-12-31" branch | wc -l

But I wonder what will you do with commits that belong to many branches?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM