private static void clone() { string wkDir = @"E:DotNet2010单位projectGit.Clientlib2TestConsoleApplication1inDebugD2Git"; string url = "http://localhost/git/test.git"; CloneOptions co = new CloneOptions { CredentialsProvider = (x,y,z) => new UsernamePasswordCredentials { Username="admin", Password="admin"} }; Repository.Clone(url, wkDir, co); }转载请注明出处:blog.csdn.net/javasuki