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

Git submodule removal and replacement results in failures

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Feb 13, 2015, 16:48 UTC
Message-ID
<CAHd499CyBk-Mt+AwLMrOjOoXKTJDk4hZBDptt3iXbo8tCiTx3g@mail.gmail.com>

Let's say I have a submodule set to directory "foo". If I remove this submodule in 1 commit (git rm -f foo) and then in a 2nd commit after that, physically commit those files, the next person that does a `git submodule update --recursive` results in failure because it says it can't overwrite files.

I'm guessing what happens here is that when the submodule is being updated, it is not de-inited first, so the 2nd commit is trying to be applied but the submodule files aren't removed first, so it thinks it is going to replace unversioned files.

Is there a way to make the submodule files be removed during an update, so that subsequent commits that may add files to replace the submodule aren't overwriting unversioned files?

Thanks.
Message 1 of 1 in “Git submodule removal and replacement results in failures”
  1. Robert DaileyFeb 13, 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.