# submodule.$name.url is ignored during submodule update

4 messages from 2015-03-19 to 2015-03-19. Participants: Dmitry Neverov, Doug Kelly.
Thread: https://gitlist.dev/t/38853

## Dmitry Neverov, 2015-03-19 09:27

Subject: submodule.$name.url is ignored during submodule update
Message-ID: <CAC+L6n1RjvzcqX33VDvcM-4CpQPHeaddA7Dhs9S+ma+T+DN28Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAC%2BL6n1RjvzcqX33VDvcM-4CpQPHeaddA7Dhs9S%2Bma%2BT%2BDN28Q%40mail.gmail.com

```
Hi,

I've noticed that the 'submodule.$name.url' config parameter from the
main repository is ignored when a submodule needs to be updated, the
submodule's 'remote.origin.url' is used instead. Is there any way to
customize the submodule url for both the initial clone and for
updates?

--
Dmitry

```

## Doug Kelly, 2015-03-19 13:09

Subject: Re: submodule.$name.url is ignored during submodule update
Message-ID: <CAEtYS8TM6KWEjpcOLL8qRmN1yEo4JGQLLJCkkQ+GHaX7F-aLJA@mail.gmail.com>
URL: https://gitlist.dev/e/CAEtYS8TM6KWEjpcOLL8qRmN1yEo4JGQLLJCkkQ%2BGHaX7F-aLJA%40mail.gmail.com
In-Reply-To: <CAC+L6n1RjvzcqX33VDvcM-4CpQPHeaddA7Dhs9S+ma+T+DN28Q@mail.gmail.com>

```
On Thu, Mar 19, 2015 at 4:27 AM, Dmitry Neverov
<dmitry.neverov@gmail.com> wrote:
> Hi,
>
> I've noticed that the 'submodule.$name.url' config parameter from the
> main repository is ignored when a submodule needs to be updated, the
> submodule's 'remote.origin.url' is used instead. Is there any way to
> customize the submodule url for both the initial clone and for
> updates?

That's what "git submodule sync" is for. It will synchronize the url
in .gitmodules with
to the remote.origin.url for each submodule.  I'm not sure about the second part
of your question: are you talking about using different URLs for the
initial clone
and updates?

```

## Dmitry Neverov, 2015-03-19 13:16

Subject: Re: submodule.$name.url is ignored during submodule update
Message-ID: <CAC+L6n1Qgh+YFfFnbLe0_3JgCMBXdya+pPraU0ZsXn0HJecaeQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAC%2BL6n1Qgh%2BYFfFnbLe0_3JgCMBXdya%2BpPraU0ZsXn0HJecaeQ%40mail.gmail.com
In-Reply-To: <CAEtYS8TM6KWEjpcOLL8qRmN1yEo4JGQLLJCkkQ+GHaX7F-aLJA@mail.gmail.com>

```
I want to use a custom url for both initial submodule clone and
submodule update. Git submodule man page states that if I run 'git
submodule init' and then change the 'submodule.$name.url' in the main
repository config, git will use this url instead of url in
.gitmodules. Git does use the custom url for initial submodule clone,
but doesn't use it when cloned submodule needs to be updated. Is that
by design?

On Thu, Mar 19, 2015 at 2:09 PM, Doug Kelly <dougk.ff7@gmail.com> wrote:
> On Thu, Mar 19, 2015 at 4:27 AM, Dmitry Neverov
> <dmitry.neverov@gmail.com> wrote:
>> Hi,
>>
>> I've noticed that the 'submodule.$name.url' config parameter from the
>> main repository is ignored when a submodule needs to be updated, the
>> submodule's 'remote.origin.url' is used instead. Is there any way to
>> customize the submodule url for both the initial clone and for
>> updates?
>
> That's what "git submodule sync" is for. It will synchronize the url
> in .gitmodules with
> to the remote.origin.url for each submodule.  I'm not sure about the second part
> of your question: are you talking about using different URLs for the
> initial clone
> and updates?

```

## Dmitry Neverov, 2015-03-19 21:29

Subject: Re: submodule.$name.url is ignored during submodule update
Message-ID: <CAC+L6n0FFtCiVWjS-TSBJRp0f81fmMHPitBeM-M6HiN-LJ_LxQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAC%2BL6n0FFtCiVWjS-TSBJRp0f81fmMHPitBeM-M6HiN-LJ_LxQ%40mail.gmail.com
In-Reply-To: <CAC+L6n1Qgh+YFfFnbLe0_3JgCMBXdya+pPraU0ZsXn0HJecaeQ@mail.gmail.com>

```
Sorry, my bad. I thought 'git submodule sync' changes only
'submodule.$name.url' in main repository config, but it also changes
the 'remote.origin.url' in submodule's config. I indeed ran 'git
submodule sync', that's why the default url was used even though
'submodule.$name.url' had a different value.

On Thu, Mar 19, 2015 at 2:16 PM, Dmitry Neverov
<dmitry.neverov@gmail.com> wrote:
> I want to use a custom url for both initial submodule clone and
> submodule update. Git submodule man page states that if I run 'git
> submodule init' and then change the 'submodule.$name.url' in the main
> repository config, git will use this url instead of url in
> .gitmodules. Git does use the custom url for initial submodule clone,
> but doesn't use it when cloned submodule needs to be updated. Is that
> by design?
>
> On Thu, Mar 19, 2015 at 2:09 PM, Doug Kelly <dougk.ff7@gmail.com> wrote:
>> On Thu, Mar 19, 2015 at 4:27 AM, Dmitry Neverov
>> <dmitry.neverov@gmail.com> wrote:
>>> Hi,
>>>
>>> I've noticed that the 'submodule.$name.url' config parameter from the
>>> main repository is ignored when a submodule needs to be updated, the
>>> submodule's 'remote.origin.url' is used instead. Is there any way to
>>> customize the submodule url for both the initial clone and for
>>> updates?
>>
>> That's what "git submodule sync" is for. It will synchronize the url
>> in .gitmodules with
>> to the remote.origin.url for each submodule.  I'm not sure about the second part
>> of your question: are you talking about using different URLs for the
>> initial clone
>> and updates?

```
