I am trying to use LibGit2Sharp for 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 message saying
Additional information: Failed to install proxy: parameter is incorrect.
But in git bash, everything is fine when I do git push origin .
We have an NTLM proxy at work, and I click on the remote URI for intranet https. I configured the proxy as http://username: password@proxy.fqdn :80 in the following:
- Env vars: HTTP_PROXY and HTTPS_PROXY
- repos.git / config:
- remote.origin.proxy
- http.proxy
- https.proxy
- http.sslCAInfo and https.sslCAInfo is the path to the root CA for the host
After reading this SO and the links there , it seems like libgit2sharp should just find the proxy setting. Has anyone got this to work with ntlm?
I use: Windows 7, LibGit2Sharp.0.22.0, git 2.10.1.windows.1, bash 4.3.46, .net4.5.2
Any ideas / tricks to achieve the push through the alternative are also very welcome!
source share