//ok private static void push () {string wkdir = @ "E:\DotNet2010\ Unit Project\git.client\lib2test\consoleapplication1\bin\debug\d2git\.git "; using (var repo = new Repository (Wkdir)) {//must be guaranteed to exist one.txt,two.txt two files at this time string fname = "One.txt"; Repo. Index.stage (fname); Repo.commit ("Add one", Constants.signature, Constants.signature); fname = "Two.txt"; Repo. Index.stage (fname); Repo.commit ("Add.", Constants.signature, Constants.signature); var nk = Repo.network; Pushoptions po = new Pushoptions {Credentialsprovider = (x, y, z) and new Usernamepas swordcredentials {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", "[Email Pro Tected] ", New DateTimeOffset (", "," 2, "," timespan.fromhours "); }
git for C #, commit local, Pushserver