threads / discuss / 60381

Proxy Flag for git-clone, push, pull

Subject: Proxy Flag for git-clone, push, pull

## tl;dr

2 messages between Oct 17, 2023 and Oct 17, 2023.

replies: 1people: 2as markdown or json

Jaydeep Das· Oct 17, 2023, 05:15 UTC · lore

To make git work through proxy, we need to set the `http.proxy` config or need to set `http_proxy` environment variable.

However wouldn't it be better if there was a flag in the command itself (like npm) which overrides whatever proxy is set. Something like

git clone --proxy "http://..." <url>
Eric Sunshine· Oct 17, 2023, 05:19 UTC · re: Jaydeep Das · lore

Re: Proxy Flag for git-clone, push, pull

On Tue, Oct 17, 2023 at 1:15 AM Jaydeep Das <jaydeepjd.8914@gmail.com> wrote:
Show 8 quoted lines
> To make git work through proxy, we need to set the `http.proxy` config
> or need to set `http_proxy` environment variable.
>
> However wouldn't it be better if there was a flag in the command
> itself (like npm) which
> overrides whatever proxy is set. Something like
>
> git clone --proxy "http://..." <url>
The -c option allows you to specify configuration on the command-line, so:
    git -c http.proxy="http://..." clone <url>
should do what you want.

← back to recent threads