Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the number of commits between 2 git tags using octokit.net?

Tags:

.net

octokit

I want to be able to get the total number of commits in a github repository between 2 git tags using octokit.net (Github .NET API).

Same as what the compare in github does.

like image 728
John Simons Avatar asked Nov 01 '22 04:11

John Simons


1 Answers

Short answer: not currently.

Longer answer: The GitHub API exposes the compare view here:

http://developer.github.com/v3/repos/commits/#compare-two-commits

So you can call it like this and get the data you need:

https://api.github.com/repos/octokit/octokit.net/compare/master...my-cool-branch

If you can wait a little longer, I've started a pull request to officially support this in Octokit.net:

https://github.com/octokit/octokit.net/pull/428

like image 82
Brendan Forster Avatar answered Nov 14 '22 10:11

Brendan Forster