Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 4

API Github - list contributors on a given branch

How to retrieve list of contributors on a branch that is not default. We would like to find the commiters each repo, irrespective of whether their changes made to master (the default branch).

3 Replies
GitHub Staff
Message 2 of 4

Re: API Github - list contributors on a given branch

GraphQL Branch and Commit Queries by Repository

 

This will get you what you're looking for by repository. You just need to pass the org and repo in as variables, or you can always hard code them.

 

You'll have to paginate through the results though if they're large enough. 

Highlighted
Copilot Lvl 2
Message 3 of 4

Re: API Github - list contributors on a given branch

Can we do this using the REST API v3?

Copilot Lvl 2
Message 4 of 4

Re: API Github - list contributors on a given branch

Can also do this with REST API:

repos/<org>/<reponame>/contributors?sha=<branchname>