Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git through a Proxy. What is causing the 407 error when cloning?

Tags:

git

github

I'm trying to use Git through a proxy. I've tried setting parameters 'git config --global' in a lot of ways but always without success when cloning repositories.

I did:

git config --global http.proxy http://DOMAIN\\\username:[email protected]:8080
git config --global http.sslverify false
git clone http://github.com/project/project.git

And I got:

$ git clone http://github.com/project/project.git folder
Cloning into 'folder'...
error: The requested URL returned error: 407 while accessing http://github.com/project/project.git/info/refs
fatal: HTTP request failed

So, how can I debug this or enable logging in Git to discover why I'm still getting the 407 error? Is there some parameter in Git to verbosely show what is happening to catch the right point where the error is occurring?

like image 788
John John Pichler Avatar asked Dec 19 '11 12:12

John John Pichler


People also ask

How do I fix error code 407?

If you are behind a firewall, you will need to configure your firewall settings to allow access to the proxy server. Once you have the correct proxy settings, the 407 Proxy Authentication Required error should be fixed.

What does error code 407 mean?

The HTTP 407 Proxy Authentication Required client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for a proxy server that is between the browser and the server that can access the requested resource.


3 Answers

I had a similar problem trying to git push from a Git Bash client in Windows.

I fixed it just by browsing to the site using Chrome.
Then I came back to Git Bash and it worked right away

For clarity, my GIT repository URL looks like http://[email protected]/myproject.git
And I browsed to http://www.cloudforge.com

My understanding is that it forces the proxy to resolve this domain.

like image 131
MonoThreaded Avatar answered Sep 20 '22 01:09

MonoThreaded


You can enable trace logging to get more information about what Git is doing. Following is an example:

GIT_TRACE=$HOME/trace.log git co master

You must use absolute paths if you want to send output to a file. Otherwise, use true or 1 to send output to standard error; e.g. GIT_TRACE=1.

like image 31
Dan Cruz Avatar answered Sep 22 '22 01:09

Dan Cruz


If you're already behind a proxy and getting this error, you will have to clear http.proxy and https.proxy: git config --global --unset http.proxy git config --global --unset https.proxy

like image 22
ShortM Avatar answered Sep 23 '22 01:09

ShortM