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

Re: fatal: could not reset submodule index

From
Stefan Beller <sbeller@google.com>
Date
Jun 15, 2018, 19:47 UTC
Message-ID
<CAGZ79kYUyzJK7a+=bQMxi=YJ5LgkS_2eJA1dB325U71ks1jjGg@mail.gmail.com>
In-Reply-To
<DB6PR0101MB2344D682511891E4E9528598D97D0@DB6PR0101MB2344.eurprd01.prod.exchangelabs.com>
Show 6 quoted lines
> # Trying again with submodule.recurse
> git config --global submodule.recurse true
> git clone main clone4 cd clone4
> git checkout with-submodule
> # Submodule is still not automatically updated (sub folder is empty)
> # It seems like submodule.recurse does not affect git clone

That is true; submodule.recurse is not affecting git clone. This was a design decision once it was introduced, as the git clone might be too large. Maybe we need to revisit that decision and just clone the submodules if submodule.recurse is set.

The problem that this bug report highlights, is the following: Each branch has its own .gitmodules file and they can be all different, however at clone time we only clone submodules from the currently active branch.

So you could get your test case to pass with
    git clone --branch with-submodule main clone5
Previous: Antoine W. CampagnaNext: Antoine W. Campagna
Message 2 of 3 in “RE: fatal: could not reset submodule index”
  1. Antoine W. CampagnaJun 14, 2018
  2. Stefan BellerJun 15, 2018
  3. Antoine W. CampagnaJun 18, 2018

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.