Question

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");
Was it helpful?

Solution

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");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top