问题
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