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

StackOverflow https://stackoverflow.com/questions/22088463

  •  18-10-2022
  •  | 
  •  

سؤال

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.

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top