I just downloaded the nugget package for libgit2sharp. Itβs hard for me to perform even basic operations.
I have an existing git repository (both remote and local). I just need to make new changes when this happens, and click on it.
I have the code below to explain what I did.
string path = @"working direcory path(local)"; Repository repo = new Repository(path); repo.Commit("commit done for ..."); Remote remote = repo.Network.Remotes["origin"]; var credentials = new UsernamePasswordCredentials {Username = "*******", Password = "******"}; var options = new PushOptions(); options.Credentials = credentials; var pushRefSpec = @"refs/heads/master"; repo.Network.Push(remote, pushRefSpec, options, null, "push done...");
Where should I provide the remote URL? Is this also the right way to perform these operations (hold and push)?
thanks
source share