git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: submodule.$name.url is ignored during submodule update

From
DNDmitry Neverov <dmitry.neverov@gmail.com>
Date
Mar 19, 2015, 13:16 UTC
Message-ID
<CAC+L6n1Qgh+YFfFnbLe0_3JgCMBXdya+pPraU0ZsXn0HJecaeQ@mail.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:
Show 16 quoted lines
> 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?
Previous: Doug KellyNext: Dmitry Neverov
Message 3 of 4 in “submodule.$name.url is ignored during submodule update”
  1. Dmitry NeverovMar 19, 2015
  2. Doug KellyMar 19, 2015
  3. Dmitry NeverovMar 19, 2015
  4. Dmitry NeverovMar 19, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.