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 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://me@me.git.cloudforge.com/myproject.git
And I browsed to http://www.cloudforge.com
My understanding is that it forces the proxy to resolve this domain.
Your proxy could also be set as an environment variable. Check if your environment has any of the env variables http_proxy or https_proxy set up and unset them.
Using command prompt
# Linux
export http://user:pass@ip_or_host:port
export http://user:pass@ip_or_host:port
# Windows
set HTTP_PROXY = http://user:pass@ip_or_host:port
set HTTPS_PROXY = http://user:pass@ip_or_host:port
change Manually
I think that you should start from the HTTP error: HTTP 407 error explained. And from that you can arrive at the answer: proxy error issue. Hope that helps.
I copied the http proxy section of my .gitconfig to https:
[http]
proxy = http://user:pass@ip_or_host:port
[https]
proxy = http://user:pass@ip_or_host:port
I put an incorrect password in the http proxy just to check, and it was ignored, so it's the https section that was missing for me.
Strangely, on another day that didn't work. I don't know if I'm going crazy or if there's another step I forgot. In today's case, this method of setting the proxy worked (with a cleared .gitconfig) from the command line:
HTTPS_PROXY="http://user:pass@ip_or_host:port/" git clone --progress -v "https://github.com/repo" local_folder
Notes:
DOMAIN\user
.If you are inside a corporate firewall and you are using windows git bash then:
Open global gitconfig file, usually this will be under C:\Users\USER_NAME.gitconfig and add the below lines if not exists.
[http]
proxy = http://USER_NAME:PASSWORD@PROXY_URL:PROXY_PORT
sslverify = false
[https]
proxy = http://USER_NAME:PASSWORD@PROXY_URL:PROXY_PORT
sslverify = false
Make sure your password does not have '@' character. If you still have the problem and you are using proxy url instead IP then: Open command - 'Windows Key+R' and type cmd then hit enter execute the command:
nslookup PROXY_URL
This will give some ip addresses. Try these ip addresses in .giconfig instead of PROXY_URL.