// OK private static void push () {string wkDir = @ "E: \ DotNet2010 \ unit project \ Git. client \ lib2Test \ leleapplication1 \ bin \ Debug \ D2Git \. git "; using (var repo = new Repository (wkDir) {// at this time, two files, one.txtand two.txt, string fname =" one.txt "; repo, must exist. index. stage (fname); repo. commit ("add one", Constants. signature, Constants. signature); fname = "two.txt"; repo. index. stage (fname); repo. commit ("add two", Constants. signature, Constants. signature); var nk = repo. network; PushOptions po = new PushOptions {CredentialsProvider = (x, y, z) => new UsernamePasswordCredentials {Username = "admin", Password = "admin"}; nk. push (repo. head, po); nk. push (repo. branches ["master"], po );}}
public static class Constants { public static readonly Signature Signature = new Signature("javasuki", "javasuki@hotmail.com", new DateTimeOffset(2014, 06, 22, 10, 58, 27, TimeSpan.FromHours(2))); }