I want to download code from public and private repository from GitHub. For this purpose I choosed octokit.net, but i have big problem to understand how I should use this lib to achieve my goal. Generally it should be done via new GitHubClient class. But when I'm trying to download code octokit.net I'm getting error that path is wrong.

var github = new GitHubClient(new ProductHeaderValue("OctokitTests"), new Uri("https://github.com/octokit/octokit.net.git);
var repository = await github.Repository.Get("onwer", "user");
有帮助吗?

解决方案

The baseAddress overload on GitHubClient is for when you need to connect to a GitHub Enterprise environment. If you're just connecting to github.com, you don't need to specify it.

var client = new GitHubClient(new ProductHeaderValue("OctokitTests"));
var repository = await github.Repository.Get("octokit", "octokit.net");
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top