如何使用cURL检索特定时间段的git commit历史记录? [英] How to retrieve git commit history for specific time period with cURL?

查看:140
本文介绍了如何使用cURL检索特定时间段的git commit历史记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以JSON格式检索提交历史记录并在txt文件中输出.

I am trying to retrieve commit history as JSON and output in a txt file.

curl https://api.github.com/repos/username/repo/commits > commitHistory.txt

上面的推荐,我只得到了提交历史的第一页.我想检索完整的提交历史记录,或者在执行时设置日期范围.我该怎么办?

With above curl commend, I only get the 1st page of the commit history. I would like to retrieve full commit history or maybe set a date range when doing it. How should I do it?

推荐答案

您可以使用sinceuntil参数仅在特定时间段内获取提交:

You can use since and until parameters to get commits only for specific time period:

curl https://api.github.com/repos/username/repo/commits?since=2016-11-01T00:00:00Z&until=2016-11-01T23:59:59Z

有关详细信息:请参见 api文档.

For details: See api doc .

这篇关于如何使用cURL检索特定时间段的git commit历史记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆