How do I clone a repository when I'm behind a proxy?

It's actually an environment variable, so try

http_proxy=http://proxy_server:4242 hg ...

You should replace 4242 with whatever port your proxy is running on.


I can successfully use the following command:

hg clone <TheURl> <Optional Folder Name> --config http_proxy.host=<proxy URL>

And obviously by replacing any <> instances with the relevant details.


You can setup proxy authentication in .hgrc file.

It store in ~/.hgrc. Here is an example.

[http_proxy]
host=hostname:port
user=username
passwd=password

Note: I currently use SourceTree app on Mac OSX.