Download the code from GitHub using octokit.net

I want to download code from a public and private repository from GitHub. For this, I chose octokit.net, but I have a big problem to understand how I should use this lib to achieve my goal. Typically, this should be done through the new GitHubClient class. But when I try to download the octokit.net code, I get an error that the 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");
+4
source share
1 answer

Overloading baseAddressis GitHubClientperformed when you need to connect to the GitHub Enterprise environment. If you just connect to github.com, you do not need to specify it.

var client = new GitHubClient(new ProductHeaderValue("OctokitTests"));
var repository = await github.Repository.Get("octokit", "octokit.net");
+6
source

Source: https://habr.com/ru/post/1525776/


All Articles