How do I clone a repository when I'm behind a proxy?
10,326
Solution 1
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.
Solution 2
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.
Solution 3
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.
Related videos on Youtube
Author by
DrColossos
Updated on September 17, 2022Comments
-
DrColossos almost 2 years
There's an option
http_proxy
which should allow access through proxy, but it's not clear whether this should be in the command line,.hgrc
or some global variable.I tried it in the command line:
hg --config=http_proxy.host=_proxy server_
but I still get a Connection timed out error.
-
Brent Bradburn about 8 yearsMay also need
export
:export http_proxy=...
-
Chris Jones over 7 yearshttp_proxy also works with https URLs. (Some other programs requires a separate https_proxy environment variable; Hg doesn't.)
-
Dmitry Ilukhin over 6 yearsIt says:hg: --config could not be shortened
-
Adam Houldsworth over 6 years@DmitryIlukhin I guess a lot can happen in 3 years, don't use Mercurial anymore so I'm not sure if the command has changed.
-
Dmitry Ilukhin over 6 yearsWorked in this format (note there is no "=" after "--config"):
hg pull -u https://hgserver.com/hg/project --config http_proxy.host=192.168.0.249:8080
-
Mir-Ismaili about 5 yearsIn Windows machines, the file is
~/mercurial.ini
. -
StayOnTarget almost 5 yearsI confirm the
=
is not needed - can someone with higher rep make the single-char edit to fix that please? -
Adam Houldsworth almost 5 years@DaveInCaz Done :-)
-
StayOnTarget almost 5 years@AdamHouldsworth :)