1

I'm trying to obtain the commits that were included on an specific release, on a repository that uses tags to identify releases. According to this answer, this doable through git log.

However, I need to gather this information for several repositories, so using an API is more convenient. Is it possible to get that information from GitHub's REST API?

Community
  • 1
  • 1

1 Answers1

3

You can use the compare two commits API:

GET /repos/:owner/:repo/compare/:base...:head

This is the same as locally running git log base..head.

Given that you want to automate this for several repos check List your Repositories API as well

Let me know if you need more info.

bitoiu
  • 6,893
  • 5
  • 38
  • 60
  • According to the documentation, base and head must be branch names. Does it work with tags? – Guillermo Guardastagno Mar 18 '16 at 20:00
  • I'm not sure if the documentation chose the word `branches` because it's more mainstream. If it accepts references then yes: https://git-scm.com/book/en/v2/Git-Internals-Git-References – bitoiu Mar 19 '16 at 00:10
  • Works like charm! The only problem is that it only returns 250 commits max. Do you know another way that doesn't have that limitation? – Guillermo Guardastagno Mar 21 '16 at 22:18