Monday, January 20, 2014

Configure Git(Hub for Windows) to work through proxies

If you’re behind a corporate firewall, chances are that you have some trouble using GitHub for Windows against a remote repository. This is because most organizations use some kind of proxy.
Most of the time you get an error like:
fatal: unable to access 'https://github.com/wullemsb/asampleapp/': Received HTTP code 407 from proxy after
 CONNECT


We have to tell GitHub for Windows to use this proxy as well. Therefore you have to edit the .gitconfig file typically found at C:\Users\<yourusername>\.gitconfig or C:\Documents & Settings\<yourusername>\.gitconfig.


In the .gitconfig file , add the following lines
   
[http]
proxy = http://myproxyserver.acme.com:8080


[https]
proxy = http://myproxyserver.acme.com:8080


As an alternative you can also use the command line:

git config --global http.proxy http://myproxyserver.acme.com:8080

No comments: