Why not use GIT run via Process? Like
Process proc = new Process();
proc.StartInfo.FileName = @"git";
proc.StartInfo.Arguments = string.Format(@"clone ""{0}"" ""{1}""", repository_address, target_directory);
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.Start();
proc.WaitForInputIdle();
I think this should work. But I might as well be wrong. :)
EDIT: with setting user credentials
// Create process
Process proc = new Process();
proc.StartInfo.FileName = @"*your_git_location*\\git-bash.exe";
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.Start();
// Wait for it to run
proc.WaitForInputIdle();
// Set up user name
proc.StandardInput.WriteLine("git config user.name ""your_user_name""");
proc.WaitForInputIdle();
// Set up user email
proc.StandardInput.WriteLine("git config user.email ""your_user_email""");
proc.WaitForInputIdle();
// Request clone of repository
proc.StandardInput.WriteLine(string.Format(@"git clone ""{0}"" ""{1}""", repository_address, target_directory););
proc.WaitForInputIdle();
// Now git should ask for your password
proc.StandardInput.WriteLine("your_password");
proc.WaitForInputIdle();
// Now clone should be complete
proc.Dispose();
This SHOULD work, I have not tested it and there might also be some syntax errors, but I believe you will figure those out. Regarding authentication in GIT, it is possible to somehow store credentials using feature called credential helper tho I am not really sure how to set this up. I think this question is good start, try researching from there:
Is there a way to skip password typing when using https:// on GitHub?