# Proxy Flag for git-clone, push, pull

2 messages from 2023-10-17 to 2023-10-17. Participants: Jaydeep Das, Eric Sunshine.
Thread: https://gitlist.dev/t/60381

## Jaydeep Das, 2023-10-17 05:15

Subject: Proxy Flag for git-clone, push, pull
Message-ID: <CACaPSotRhyFZ-eBZ9KNKRUjLFHKo09P-Un+sitDXEktzmwuaxA@mail.gmail.com>
URL: https://gitlist.dev/e/CACaPSotRhyFZ-eBZ9KNKRUjLFHKo09P-Un%2BsitDXEktzmwuaxA%40mail.gmail.com

```
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, 2023-10-17 05:19

Subject: Re: Proxy Flag for git-clone, push, pull
Message-ID: <CAPig+cR8-s3bGCw6qF12Bcxuy4vB8Gh9H5jTb_r3pUu1LK35-g@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcR8-s3bGCw6qF12Bcxuy4vB8Gh9H5jTb_r3pUu1LK35-g%40mail.gmail.com
In-Reply-To: <CACaPSotRhyFZ-eBZ9KNKRUjLFHKo09P-Un+sitDXEktzmwuaxA@mail.gmail.com>

```
On Tue, Oct 17, 2023 at 1:15 AM Jaydeep Das <jaydeepjd.8914@gmail.com> wrote:
> 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.

```
