GitHub API单一提交不获取所有文件 [英] GitHub API Single Commit dont fetch all files

查看:104
本文介绍了GitHub API单一提交不获取所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据GitHub Api V3文档,您可以使用此单次提交

According to GitHub Api V3 Document, to get a single commit you use this

https://api.github.com/repos:owner/repo:提交/sha

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

I can access the api but didn't give me the right result

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

I should get 373 files, but I only got 300?

怎么了,在检索单个提交的详细信息时,github是否也有局限性?

what's wrong, does github also have limitations when retrieving details of a single commit?

注意:

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

I already checked my page and take a look with the commit im referring to, It shows that 373 files were changed.

谢谢您的帮助!

推荐答案

GitHub API文档似乎并未提及对提交列表的具体限制,但在文档的其他地方提到了300个文件的限制;例如,列出请求请求文件的API的文档:

The GitHub API docs don’t seem to mention a specific limit on commit listings but a 300-file limit is mentioned in other places in the docs; for example, the docs for the API for listing pull-request files:

注意:该回复最多包含300个文件.

Note: The response includes a maximum of 300 files.

并且在 查看存储库中内容和差异的限制 文档:

And in the Limits for viewing content and diffs in a repository docs:

以下大多数限制都会影响GitHub Enterprise 和API .

由于差异可能会变得很大,因此我们对差异施加了这些限制 提交,拉取请求和比较视图:

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

  • 单个文件的差异不能超过3,000行或100 KB的原始差异数据.视图中所有文件的差异总大小可能不会 超过20,000行或1 MB.

  • 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.

单个差异中的最大文件数限制为300 .

...

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

The 300-file limit is also mentioned here at Stackoverflow in other answers:

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

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

Those both quote a GitHub rep as saying:

我们对浏览器中显示的差异进行了一些限制,以保持拉取请求和比较页面正常运行.目前,我们在以下位置切断了它们:

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个文件,
  • 总差异为1MB
  • 和单个差异100KB.
  • 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.

这篇关于GitHub API单一提交不获取所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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