1

I can't git clone https://code.google.com/my-repo, so I want set git through my local client proxy 127.0.0.1:8087. How to config? Thank you.

Honghe.Wu
  • 5,899
  • 6
  • 36
  • 47

1 Answers1

3

Try setting the https_proxy environment variable before cloning. For example:

export https_proxy=127.0.0.1:8087
git clone https://wherever/whatever.git

... as suggested in the answer to this question and in the comments on GitHub's announcement of Smart HTTP support.

Community
  • 1
  • 1
Mark Longair
  • 446,582
  • 72
  • 411
  • 327
  • Roughly speaking, if you just do `https_proxy=whatever` that value will only be available in the current shell - the `git clone` command will not have that environment variable set in its environment. If you do `export https_proxy=whatever`, however, that environment variable will also be set in the environment of subsequent commands invoked from the shell. The documentation for `export` in bash can be found [here](http://www.gnu.org/s/bash/manual/bash.html#index-export-115). – Mark Longair Oct 03 '11 at 08:01
  • @HuangheWoo: no problem. Since this answer turned out to be helpful for you, it's conventional on Stack Overflow to accept it by clicking on the tick beside the answer. – Mark Longair Oct 03 '11 at 09:03