Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.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';s API以获取每次提交(在分支上)添加/删除的代码行?_Github_Github Api - Fatal编程技术网

使用GitHub';s API以获取每次提交(在分支上)添加/删除的代码行?

使用GitHub';s API以获取每次提交(在分支上)添加/删除的代码行?,github,github-api,Github,Github Api,下面是项目的主分支提交的原始列表: https://api.github.com/repos/<organization_name>/<repo_name/commits?page=0&per_page=30 https://api.github.com/repos//您可以使用params中的sha={branchname}param获取特定的分支 shastringsha或开始列出提交的分支。默认:存储库的默认分支(通常是主分支) 很抱歉,我认为没有办法在原始的/

下面是项目的
主分支提交的原始列表:

https://api.github.com/repos/<organization_name>/<repo_name/commits?page=0&per_page=30

https://api.github.com/repos//您可以使用params中的
sha={branchname}
param获取特定的分支

sha
string
sha或开始列出提交的分支。默认:存储库的默认分支(通常是主分支)


很抱歉,我认为没有办法在原始的
/commits
端点调用中获得每个文件的更改,您必须执行多个调用…

感谢分享。我不知道为什么github需要额外的呼叫,浪费每个人的资源。。。
https://api.github.com/repos/<org_name>/<repo_name>/commits?sha=<branchName>&page=0&per_page=30
"files": [
    {
      "sha": "8aaaa7de53bed57fc2865d2fd84897211c3e70b6",
      "filename": "lombok.config",
      "status": "added",
      "additions": 1,
      "deletions": 0,
      "changes": 1,
      "blob_url": "https://github.com/buraequete/orikautomation/blob/89792e6256dfccc5e9151d81bf04145ba02fef8f/lombok.config",
      "raw_url": "https://github.com/buraequete/orikautomation/raw/89792e6256dfccc5e9151d81bf04145ba02fef8f/lombok.config",
      "contents_url": "https://api.github.com/repos/buraequete/orikautomation/contents/lombok.config?ref=89792e6256dfccc5e9151d81bf04145ba02fef8f",
      "patch": "@@ -0,0 +1 @@\n+lombok.accessors.chain = true"
    },
    ...
]