在一个特定的时间范围内,git/GitHub上的提交总数?

4urapxun  于 2022-12-02  发布在  Git
关注(0)|答案(5)|浏览(197)

如何通过GitHub网络界面了解项目的提交总数?如何获得特定时间段内的提交总数?
我现在能得到的是每个开发人员完成的提交次数,而不是总数。
示例:https://github.com/BVLC/caffe

jljoyd4f

jljoyd4f1#

因为你的标签和问题行并不局限于GitHub界面,你可以从命令行得到你想要的:

$ git rev-list --count master --since=5.months
577
$ git rev-list --count master --since=4.months
524

除了--since之外,它还支持--until来指定完整的范围。Manual Reference
另请参阅:What date formats does git log accept for date parameters?

b91juud3

b91juud32#

要进入比较视图,请将/compare附加到存储库得路径.每个存储库得“比较”视图都包含两个下拉菜单:基准和比较
要比较时间范围内的提交,您可以在比较下拉列表中输入分支名称,后跟一个@,然后用{ }符号表示日期。
以下是两个示例:
Date Compairson
Time entered in Weeks

来源https://help.github.com/articles/comparing-commits-across-time/
使用GitHub Web界面完成的提交:

不管你是从git界面还是web界面提交,提交都是提交,我想没有办法识别它。

每个开发人员完成的提交:

您提供的链接中明确提到:
Contributors

u7up0aaq

u7up0aaq3#

它显示在项目主页的左上角:

bf1o4zei

bf1o4zei4#

您可以通过两种不同的方式获得一段时间内的提交总数
第一条路
使用since和before - since取开始日期,before取结束日期,你想从它那里得到提交。

git rev-list --count HEAD --since="Dec 1 2021"  --before="Jan 3 2022"

第二条路
使用[秒-小时-日-周-月-年]获取提交总数
获取秒提交总数

git rev-list --count HEAD  --since=600.second

按分钟获取提交总数

git rev-list --count HEAD  --since=30.minute

获取每天的提交总数

git rev-list --count HEAD  --since=28.day

按周获取提交总数

git rev-list --count HEAD  --since=4.week

按月获取提交总数

git rev-list --count HEAD  --since=1.month

按年份获取提交总数

git rev-list --count HEAD  --since=2.year
vwkv1x7d

vwkv1x7d5#

转到https://github.com/USER_NAME/REPOSITORY。在您的情况下,您必须转到https://github.com/BVLC/caffe
访问上述页面后,您可以看到total number of commits。请参考下图:

相关问题