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

Re: possible submodule bug?

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jun 1, 2019, 01:12 UTC
Message-ID
<20190601011206.GO8616@genre.crustytoothpaste.net>
In-Reply-To
<BN8PR11MB35711F87B0981C6897DCE3CC89180@BN8PR11MB3571.namprd11.prod.outlook.com>
On 2019-05-30 at 18:16:17, Alex Levy wrote:
> I've found a workaround if I manually edit .git/config in each clone to reflect the correct URL.  After doing that, running "git submodule update --init" works as expected.
> 
> My understanding is that I shouldn't ever have to edit anything in the .git directory.  So, have I found a bug with .gitmodules being ignored after adding a given submodule?  Or is this just user error, a case of "Don't do that.  Initialize the submodule with the correct URL and move on."?
git-submodule(1) documents this behavior under the init subcommand:
  When present, it will also copy the value of `submodule.$name.update`.
  This command does not alter existing information in .git/config. You
  can then customize the submodule clone URLs in .git/config for your
  local setup and proceed to `git submodule update`; you can also just
  use `git submodule update --init` without the explicit 'init' step if
  you do not intend to customize any submodule locations.

The goal is to let you customize the URL. For example, maybe you are using an open-source project with submodules but you're on a restricted corporate network where access to certain sites is prohibited, or maybe the server hosting the submodule is down temporarily or permanently.

So this isn't really a bug, but more of a feature, even if it's inconvenient in this particular case.

You can, however, use "git submodule sync" to sync across updated changes to the URL. This is a bunch easier and faster than editing things by hand or with "git config".

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Alex Levy
Message 2 of 2 in “possible submodule bug?”
  1. Alex LevyMay 30, 2019
  2. brian m. carlsonJun 1, 2019

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.