octokit.net

Octokit.net Creating new repository

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-27 13:03:26
问题 I have a problem with creating new repository with Octokit.net. This is my code: public async Task stvoriNovi(FormCollection collection) { string name = collection.Get("name"); NewRepository newRepo = new NewRepository(name); newRepo.AutoInit = true; var accessToken = Session["OAuthToken"] as string; if (accessToken != null) { client.Credentials = new Credentials(accessToken); } await client.Repository.Create(newRepo); } I've put breakpoints and there I see that everything is OK. http:/

How to upload a Zip File using Octokit?

折月煮酒 提交于 2019-12-25 17:48:28
问题 How to upload a zip file using Octokit.net? I am new to Octokit.net anyone could you possible provide code snippet? 回答1: The ocktokit.net docs are quite complete, read the docs well. This is an example from the docs: var client = new GitHubClient(new ProductHeaderValue("my-cool-app")); var basicAuth = new Credentials("username", "password"); // NOTE: not real credentials client.Credentials = basicAuth; using(var archiveContents = File.OpenRead("output.zip")) { // TODO: better sample var

Cannot get repository contents as .zip file (zipball) in Octokit.net

萝らか妹 提交于 2019-12-14 03:53:10
问题 I am using Octokit.net version 0.9.0 (GitHub API for .NET) for getting zip contents of few repositories. I already have the list of repositories I need but I am having trouble with getting the the content of the repositories as .zip files (called zipball) What I've tried so far // ... client = new Client(...); // some authentication logic... // some other queries to GitHub that work correctly var url = "https://api.github.com/repos/SomeUser/SomeRepo/zipball"; var response = await this.client

Updating a file in GitHub repository using Octokit

大兔子大兔子 提交于 2019-12-09 22:35:23
问题 I am trying to develop a windows forms application that can create, update and delete files in a GitHub repository using Octokit. public Form1() { InitializeComponent(); var ghClient = new GitHubClient(new ProductHeaderValue("Octokit-Test")); ghClient.Credentials = new Credentials("-personal access token here-"); // github variables var owner = "username"; var repo = "repository name"; var branch = "master"; // create file //var createChangeSet = ghClient.Repository.Content.CreateFile(owner

Updating a file in GitHub repository using Octokit

烈酒焚心 提交于 2019-12-04 17:04:48
I am trying to develop a windows forms application that can create, update and delete files in a GitHub repository using Octokit. public Form1() { InitializeComponent(); var ghClient = new GitHubClient(new ProductHeaderValue("Octokit-Test")); ghClient.Credentials = new Credentials("-personal access token here-"); // github variables var owner = "username"; var repo = "repository name"; var branch = "master"; // create file //var createChangeSet = ghClient.Repository.Content.CreateFile(owner,repo,"path/file2.txt",new CreateFileRequest("File creation", "Hello World!", branch)); // update file