Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
github v3 api相当于/v2/json/commits/list_Github_Github Api - Fatal编程技术网

github v3 api相当于/v2/json/commits/list

github v3 api相当于/v2/json/commits/list,github,github-api,Github,Github Api,我使用/v2/json/commits/list/:user/:repo/:branch来列出分支的提交。这有两个问题: 它一次只返回35个项目 它是v2api的一部分,已经被弃用了(v3api被记录为beta版,所以我想如果我这样做,我会觉得很糟糕,如果我做了更新的话,我会觉得很糟糕) 上述v2 api的v3等价物是什么 我查看了/repos/:user/:repo/commits和/repos/:user/:repo/git/commits: /repos/:user/:repo/co

我使用/v2/json/commits/list/:user/:repo/:branch来列出分支的提交。这有两个问题:

  • 它一次只返回35个项目
  • 它是v2api的一部分,已经被弃用了(v3api被记录为beta版,所以我想如果我这样做,我会觉得很糟糕,如果我做了更新的话,我会觉得很糟糕)
上述v2 api的v3等价物是什么

我查看了/repos/:user/:repo/commits和/repos/:user/:repo/git/commits:

  • /repos/:user/:repo/commits接受sha或分支作为参数,但传入时仅返回1个commit
  • /repos/:user/:repo/git/commits不将分支作为参数
  • 如果我没有指定分支,那么两个分支都不能明确指定提交的是哪个分支

是否有v3版本的等价物,或者我现在是否仍使用v2?

通过查看检索单个提交的github v3 API,以下内容对我很有用:

/repos/{owner}/{repo}/commits/{branch}