我想从GitHub下载公共和私有存储库中的代码。为此我选择了octokit.net,但是我有很大的问题要理解我应该如何使用这个lib来实现我的目标。通常应该通过新的GitHubClient类来完成。但是当我试图下载代码octokit.net时,我收到路径错误的错误。
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"), new Uri("https://github.com/octokit/octokit.net.git);
var repository = await github.Repository.Get("onwer", "user");
答案 0 :(得分:6)
baseAddress
上的GitHubClient
重载适用于需要连接到GitHub Enterprise环境的情况。如果您只是连接到github.com,则无需指定它。
var client = new GitHubClient(new ProductHeaderValue("OctokitTests"));
var repository = await github.Repository.Get("octokit", "octokit.net");