GitLab API to get all commits of a specific branch

江枫思渺然 提交于 2020-01-03 15:36:47

问题


By default, the API GET /projects/:id/repository/commits gets commits of master branch, but I want to get other branch's commits.


回答1:


According to Gitlab docs you can add parameter "ref_name" and specify the branch from which you want to get the commits:

GET /projects/:id/repository/commits?ref_name=my_branch_name



回答2:


I will complement the answer by K. Gol: Need to add params: per_page and page. The value more than 100 has been ignored for the param per_page.



来源:https://stackoverflow.com/questions/43733179/gitlab-api-to-get-all-commits-of-a-specific-branch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!