stackyyflow stackyyflow - 1 month ago 7
Git Question

Retrieve all commits from Git statistics API

I want to retrieve ALL commits from Github using Git Statistics API:

GET /repos/:owner/:repo/commits


I tried to use
curl https://api.github.com/repos/:owner/:repo/commits
but it does not show me ALL commits, but a few latest. Is there a way to just retrieve the entire list of commits?

Answer

You need to follow "Traversing with Pagination" in order to retrieve all commits, because the result of such a commit query will be most likely paginated.
That is detailed in "Improved pagination for the Repository Commits API" (May 2014)

That would avoid sending back a result too big in one answer over http.