Department of Telelcom (India) just blocked some sites in India.

But, only Government-based ISPs block access those sites. Other ISPs still have these sites working. One of those sites is Github and I want to use Github.

How can I apply proxy settings so they work for git sessions to Github in a Terminal?

(Note: I saw this link for doing this in Linux but I guess OS X is little different from Ubuntu?)


From the StackOverflow Q&A entitled "Getting git to work with a proxy server?":

Command to use :

git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
git config --global https.proxy https://proxyuser:proxypwd@proxy.server.com:8080
  • change proxyuser by your proxy user
  • change proxypwd by your prxy password
  • change proxy.server.com by proxy server url
  • change 8080 by proxy port

If you decide at any time to reset this proxy and work without (no proxy):

Commands to use:

git config --global --unset http.proxy
git config --global --unset https.proxy

Git also respects the http_proxy and https_proxy environment variables.

Not the answer you're looking for? Browse other questions tagged .