GitHub API Single Commit不提取所有文件

根据
GitHub Api V3 Document,要获得单个提交,请使用此方法

https://api.github.com/repos:owner/repo:commits/sha

我可以访问api,但没有给我正确的结果

我应该得到373个文件,但我只有300个?

有什么不对,github在检索单个提交的细节时也有局限性吗?

注意:

我已经检查了我的页面并查看了我提到的提交,它显示373个文件已被更改.

感谢您的任何帮助!

最佳答案 GitHub API文档似乎没有提及提交列表的特定限制,但在文档的其他位置提到了300个文件的限制;例如,
the API for listing pull-request files的文档:

Note: The response includes a maximum of 300 files.

Limits for viewing content and diffs in a repository文档中:

Most of the limits below affect both GitHub Enterprise and the API.

Diff limits

Because diffs can become very large, we impose these limits on diffs
for commits, pull requests, and compare views:

  • No single file’s diff may exceed 3,000 lines or 100 KB of raw diff data. The total size of a diff across all files in a view may not
    exceed 20,000 lines or 1 MB.

  • The maximum number of files in a single diff is limited to 300.

Stackoverflow在其他答案中也提到了300个文件的限制:

> Large github commit diff not shown
> github Diff Truncated error

这两个人都引用GitHub代表的话说:

We have some limits on diffs that we show in the browser in order to keep the pull request and compare pages working. Currently, we cut them off at:

  • 300 files,
  • a total diff of 1MB,
  • and an individual diff of 100KB.

If your diffs exceed the limits and can’t be viewed online, you can always pull the changes locally and view the diff there. It may not be as convenient for you, but it’ll get the job done.

点赞