I am trying to use LibGit2Sharp to git push origin using the following
using(var repo = new Repository("path\to\repo\.git"))
{
var commit = repo.Commit("Commit message", author, committer);
var options = new PushOptions{ CredentialsProvider = (u, s, t) => new UserNamePasswordCredentials { Username = "username", Password = "password" } };
repo.Network.Push(repo.Branches("master"), options);
}
I get a LibGit2SharpException saying
Additional information: Failed to set proxy: The parameter is incorrect.
But in git bash everything is fine when I do git push origin.
We have NTLM proxy at work, and I am pushing to an intranet https remote URI. I have configured the proxy as http://username:[email protected]:80 in the following:
- Env vars: HTTP_PROXY & HTTPS_PROXY
- repos .git/config:
- remote.origin.proxy
- http.proxy
- https.proxy
- http.sslCAInfo & https.sslCAInfo - this is the path to the root CA for the host
Having read through this SO and links there it seems like libgit2sharp should find the proxy parameter just fine. Has anyone gotten this to work behing ntlm?
I am using: Windows 7, LibGit2Sharp.0.22.0, Git 2.10.1.windows.1, bash 4.3.46, .net4.5.2
Any ideas/tricks on achieving the push through an alternative are greatly welcome too!