Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get all the statistics for a Github repository using the API?

I want to achieve something like git log --stat achieves using the Github API.

I want to get all the commits that occurred in a repository along with the files that were changed in that particular commit.

How should I go about doing this with the Github API?

like image 517
Ankit Vadehra Avatar asked Dec 12 '15 15:12

Ankit Vadehra


People also ask

How do I get stats on GitHub?

You can find the link to the left of the nav bar. It is able to compute stats for a project (a group of git repositories) as well as for a contributor and a group of contributors. It provides a REST interface and a web UI.

How do I fetch all GitHub repository?

How To List All Public Repositories Belonging to a User? So, to list all public repos from a user, send a GET request to https://api.github.com/users/<USER-NAME>/repos , replacing with the actual user from whom you want to retrieve the repositories.

Is there a GitHub API?

Github APIs( or Github ReST APIs) are the APIs that you can use to interact with GitHub. They allow you to create and manage repositories, branches, issues, pull requests, and many more. For fetching publicly available information (like public repositories, user profiles, etc.), you can call the API.


1 Answers

First grab the commits from https://api.github.com/repos/:owner/:project/commits

curl -i https://api.github.com/repos/masnun/torrent-tweeter/commits

Then you can use the commits API to get the changed files. https://developer.github.com/v3/repos/commits/#get-a-single-commit

like image 60
masnun Avatar answered Oct 12 '22 22:10

masnun