How to get number of commits from a public organization repo in Github

Viewed 410
1 Answers

According to the Github docs on this topic, gathering the repositories stats is an expensive operation, so the data is cached.

It returns an empty object with a 202 response code if there's no data cached, and a job to generate the stats for this repository is queued. You'll get a response code 200 if you repeat your request once the job has finished. I believe this is the behavior you were encountering.

I have tried with a few (small) private repositories and the stats were generated in seconds, although it may take significantly longer for repositories with a huge commit history or a large number of contributors.

Related