Skip to main content
 首页 » 编程设计

python之如何使用 API 获取 Github 存储库的所有统计信息

2024年10月24日12davidwang456

我想使用 Github API 实现类似 git log --stat 的效果。

我想获取存储库中发生的所有提交以及在该特定提交中更改的文件。

我应该如何使用 Github API 执行此操作?

请您参考如下方法:

首先从 https://api.github.com/repos/:owner/:project/commits 获取提交

curl -i https://api.github.com/repos/masnun/torrent-tweeter/commits 

然后您可以使用提交 API 来获取更改的文件。 https://developer.github.com/v3/repos/commits/#get-a-single-commit