如何计算日期范围内每个用户的 git 提交?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31190474/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to count git commits per user in a date range?
提问by Westwick
The command git shortlog -sne
is exactly what I need, but I want to be able to specify a date range for that which isn't an option for shortlog
. Is there another way to accomplish this same thing, but for a specific date range?
该命令git shortlog -sne
正是我所需要的,但我希望能够为shortlog
. 有没有另一种方法可以完成同样的事情,但针对特定的日期范围?
回答by Mureinik
Although git shortlog --help
doesn't seem to specify it, shortlog
takes the same --since
, --after
, --before
and --until
parameters that git log
does. So, for example:
虽然git shortlog --help
似乎没有指定,shortlog
采用相同的--since
,--after
,--before
和--until
参数git log
一样。因此,例如:
git shortlog -sne --since="01 Jan 2015" --before="01 Feb 2015"
Note:
This was verified on git 2.1.0 running on Fedora 21 and on git 1.8.3.1 running on RHEL 7.1. I don't have older systems at hand, but I believe these parameters were supported there for a while.
注意:
这已在 Fedora 21 上运行的 git 2.1.0 和 RHEL 7.1 上运行的 git 1.8.3.1 上得到验证。我手头没有旧的系统,但我相信这些参数在那里得到了一段时间的支持。