{"thread":{"id":"38565","subject":"Git submodule removal and replacement results in failures","startedAt":"2015-02-13T16:48:38Z","lastAt":"2015-02-13T16:48:38Z","messageCount":1,"participants":["Robert Dailey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"256064","messageId":"CAHd499CyBk-Mt+AwLMrOjOoXKTJDk4hZBDptt3iXbo8tCiTx3g@mail.gmail.com","threadId":"38565","inReplyTo":null,"subject":"Git submodule removal and replacement results in failures","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2015-02-13T16:48:38Z","receivedAt":"2015-02-13T16:48:38Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"Let's say I have a submodule set to directory \"foo\". If I remove this\nsubmodule in 1 commit (git rm -f foo) and then in a 2nd commit after\nthat, physically commit those files, the next person that does a `git\nsubmodule update --recursive` results in failure because it says it\ncan't overwrite files.\n\nI'm guessing what happens here is that when the submodule is being\nupdated, it is not de-inited first, so the 2nd commit is trying to be\napplied but the submodule files aren't removed first, so it thinks it\nis going to replace unversioned files.\n\nIs there a way to make the submodule files be removed during an\nupdate, so that subsequent commits that may add files to replace the\nsubmodule aren't overwriting unversioned files?\n\nThanks.\n"}]}