# Git submodule first time update with proxy

5 messages from 2015-01-23 to 2015-01-24. Participants: Robert Dailey, Chris Packham.
Thread: https://gitlist.dev/t/38439

## Robert Dailey, 2015-01-23 02:50

Subject: Git submodule first time update with proxy
Message-ID: <CAHd499BEmV2zeosE9th59QTWPA0CPsU8eyHnONhsZqEb=bH+rA@mail.gmail.com>
URL: https://gitlist.dev/e/CAHd499BEmV2zeosE9th59QTWPA0CPsU8eyHnONhsZqEb%3DbH%2BrA%40mail.gmail.com

```
I have a submodule using HTTP URL. I do this:

$ git submodule init MySubmodule
$ git submodule update MySubmodule

The 2nd command fails because the HTTP URL cannot be resolved, this is
because it requires a proxy. I have "http.proxy" setup properly in the
.git/config of my parent git repository, so I was hoping the submodule
update function would have a way to specify it to inherit the proxy
value from the parent config.

How can I set up my submodule?

```

## Chris Packham, 2015-01-23 22:13

Subject: Re: Git submodule first time update with proxy
Message-ID: <CAFOYHZAiZkXqSkso+=Eh_THEkh+qi9k8xWsP0yt1dbw5ymwDDQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAFOYHZAiZkXqSkso%2B%3DEh_THEkh%2Bqi9k8xWsP0yt1dbw5ymwDDQ%40mail.gmail.com
In-Reply-To: <CAHd499BEmV2zeosE9th59QTWPA0CPsU8eyHnONhsZqEb=bH+rA@mail.gmail.com>

```
Hi,

On Fri, Jan 23, 2015 at 3:50 PM, Robert Dailey <rcdailey.lists@gmail.com> wrote:
> I have a submodule using HTTP URL. I do this:
>
> $ git submodule init MySubmodule
> $ git submodule update MySubmodule
>
> The 2nd command fails because the HTTP URL cannot be resolved, this is
> because it requires a proxy. I have "http.proxy" setup properly in the
> .git/config of my parent git repository, so I was hoping the submodule
> update function would have a way to specify it to inherit the proxy
> value from the parent config.

Your not the first to suggest it and you probably won't be the last.
It is hard to decide _which_ config variables, if any, should
propagate from the parent. What works for one use-case may not
necessarily work for another.

> How can I set up my submodule?

Probably the easiest thing would be to make your http.proxy
configuration global i.e.

  $ git config --global http.proxy ....

If you don't want to make it a global setting you can setup the
submodule configuration after running init but before running update
i.e.

  $ git submodule init MySubmodule
  $ (cd MySubmodule && git config http.proxy ...)
  $ git submodule update MySubmodule

```

## Robert Dailey, 2015-01-24 04:23

Subject: Re: Git submodule first time update with proxy
Message-ID: <CAHd499A+K=uh=wt4P_qy+8XOEttTziJEPvhE+=03oD_MRxna2Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAHd499A%2BK%3Duh%3Dwt4P_qy%2B8XOEttTziJEPvhE%2B%3D03oD_MRxna2Q%40mail.gmail.com
In-Reply-To: <CAFOYHZAiZkXqSkso+=Eh_THEkh+qi9k8xWsP0yt1dbw5ymwDDQ@mail.gmail.com>

```
On Fri, Jan 23, 2015 at 4:13 PM, Chris Packham <judge.packham@gmail.com> wrote:
> Hi,
>
> On Fri, Jan 23, 2015 at 3:50 PM, Robert Dailey <rcdailey.lists@gmail.com> wrote:
>> I have a submodule using HTTP URL. I do this:
>>
>> $ git submodule init MySubmodule
>> $ git submodule update MySubmodule
>>
>> The 2nd command fails because the HTTP URL cannot be resolved, this is
>> because it requires a proxy. I have "http.proxy" setup properly in the
>> .git/config of my parent git repository, so I was hoping the submodule
>> update function would have a way to specify it to inherit the proxy
>> value from the parent config.
>
> Your not the first to suggest it and you probably won't be the last.
> It is hard to decide _which_ config variables, if any, should
> propagate from the parent. What works for one use-case may not
> necessarily work for another.
>
>> How can I set up my submodule?
>
> Probably the easiest thing would be to make your http.proxy
> configuration global i.e.
>
>   $ git config --global http.proxy ....
>
> If you don't want to make it a global setting you can setup the
> submodule configuration after running init but before running update
> i.e.
>
>   $ git submodule init MySubmodule
>   $ (cd MySubmodule && git config http.proxy ...)
>   $ git submodule update MySubmodule

 For some reason, the init call does not create the submodule
directory as you indicate. I also checked in .git/modules and it's not
there either.

```

## Robert Dailey, 2015-01-24 04:45

Subject: Re: Git submodule first time update with proxy
Message-ID: <CAHd499B+ZAAYAtDdsX=v4H60dq3wuVgR0Hk7x6NRubMJ_Umjjg@mail.gmail.com>
URL: https://gitlist.dev/e/CAHd499B%2BZAAYAtDdsX%3Dv4H60dq3wuVgR0Hk7x6NRubMJ_Umjjg%40mail.gmail.com
In-Reply-To: <CAHd499A+K=uh=wt4P_qy+8XOEttTziJEPvhE+=03oD_MRxna2Q@mail.gmail.com>

```
On Fri, Jan 23, 2015 at 10:23 PM, Robert Dailey
<rcdailey.lists@gmail.com> wrote:
> On Fri, Jan 23, 2015 at 4:13 PM, Chris Packham <judge.packham@gmail.com> wrote:
>> Hi,
>>
>> On Fri, Jan 23, 2015 at 3:50 PM, Robert Dailey <rcdailey.lists@gmail.com> wrote:
>>> I have a submodule using HTTP URL. I do this:
>>>
>>> $ git submodule init MySubmodule
>>> $ git submodule update MySubmodule
>>>
>>> The 2nd command fails because the HTTP URL cannot be resolved, this is
>>> because it requires a proxy. I have "http.proxy" setup properly in the
>>> .git/config of my parent git repository, so I was hoping the submodule
>>> update function would have a way to specify it to inherit the proxy
>>> value from the parent config.
>>
>> Your not the first to suggest it and you probably won't be the last.
>> It is hard to decide _which_ config variables, if any, should
>> propagate from the parent. What works for one use-case may not
>> necessarily work for another.
>>
>>> How can I set up my submodule?
>>
>> Probably the easiest thing would be to make your http.proxy
>> configuration global i.e.
>>
>>   $ git config --global http.proxy ....
>>
>> If you don't want to make it a global setting you can setup the
>> submodule configuration after running init but before running update
>> i.e.
>>
>>   $ git submodule init MySubmodule
>>   $ (cd MySubmodule && git config http.proxy ...)
>>   $ git submodule update MySubmodule
>
>  For some reason, the init call does not create the submodule
> directory as you indicate. I also checked in .git/modules and it's not
> there either.

Correction:

I have to deinit the submodule then init again, then the submodule dir
is created (but empty). When I run the git config command inside the
submodule directory, it silently returns and does not indicate
failure, however the final git submodule update command shows failure
to access the remote and then subsequently the submodule empty
directory is removed by Git.

```

## Chris Packham, 2015-01-24 05:47

Subject: Re: Git submodule first time update with proxy
Message-ID: <CAFOYHZBqLPzE94sbb=RoD0yViqPhJ+DRnYJQ6o_2taF1DhhHhA@mail.gmail.com>
URL: https://gitlist.dev/e/CAFOYHZBqLPzE94sbb%3DRoD0yViqPhJ%2BDRnYJQ6o_2taF1DhhHhA%40mail.gmail.com
In-Reply-To: <CAHd499B+ZAAYAtDdsX=v4H60dq3wuVgR0Hk7x6NRubMJ_Umjjg@mail.gmail.com>

```
On Sat, Jan 24, 2015 at 5:45 PM, Robert Dailey <rcdailey.lists@gmail.com> wrote:
> On Fri, Jan 23, 2015 at 10:23 PM, Robert Dailey
> <rcdailey.lists@gmail.com> wrote:
>> On Fri, Jan 23, 2015 at 4:13 PM, Chris Packham <judge.packham@gmail.com> wrote:
>>> Hi,
>>>
>>> On Fri, Jan 23, 2015 at 3:50 PM, Robert Dailey <rcdailey.lists@gmail.com> wrote:
>>>> I have a submodule using HTTP URL. I do this:
>>>>
>>>> $ git submodule init MySubmodule
>>>> $ git submodule update MySubmodule
>>>>
>>>> The 2nd command fails because the HTTP URL cannot be resolved, this is
>>>> because it requires a proxy. I have "http.proxy" setup properly in the
>>>> .git/config of my parent git repository, so I was hoping the submodule
>>>> update function would have a way to specify it to inherit the proxy
>>>> value from the parent config.
>>>
>>> Your not the first to suggest it and you probably won't be the last.
>>> It is hard to decide _which_ config variables, if any, should
>>> propagate from the parent. What works for one use-case may not
>>> necessarily work for another.
>>>
>>>> How can I set up my submodule?
>>>
>>> Probably the easiest thing would be to make your http.proxy
>>> configuration global i.e.
>>>
>>>   $ git config --global http.proxy ....
>>>
>>> If you don't want to make it a global setting you can setup the
>>> submodule configuration after running init but before running update
>>> i.e.
>>>
>>>   $ git submodule init MySubmodule
>>>   $ (cd MySubmodule && git config http.proxy ...)
>>>   $ git submodule update MySubmodule
>>
>>  For some reason, the init call does not create the submodule
>> directory as you indicate. I also checked in .git/modules and it's not
>> there either.
>

OK I must be wrong about that. I was working from memory. Trying it
now I see the error in my thinking

  $ git submodule init bar
  Submodule 'bar' (bar.git) registered for path 'bar'

I thought this meant that bar/.git (and .git/modules/bar) had been
created but as you point out I was wrong.

> Correction:
>
> I have to deinit the submodule then init again, then the submodule dir
> is created (but empty).

That's the default state of an uninitialized submodule.

> When I run the git config command inside the
> submodule directory, it silently returns and does not indicate
> failure, however the final git submodule update command shows failure
> to access the remote and then subsequently the submodule empty
> directory is removed by Git.

So it looks like the only solution to your problem right now is to use
git config --global for your proxy configuration.

```
