3

Following up to this question: No submodule mapping found in .gitmodule for a path that's not a submodule

If you remove a submodule from .gitmodules, and then run git submodule update --init, git may complain

No submodule mapping found in .gitmodules for path 'my/submodule

The generally accepted solution is to run

git rm --cached my/submodule

and afterwards run git submodule update --init again.

What's a good way to deal with this in Continuous Integration?

I can't SSH into the CI server every time somebody remotes a submodule, and neither do I want to wipe the entire git repository.

Is there a git command with which I can git rm all such former submodules, where I don't have to give the explicit path (e.g. my/submodule), so that I can run every time CI runs, and have git submodule update --init work every time?

Community
  • 1
  • 1
nh2
  • 24,526
  • 11
  • 79
  • 128
  • What are your thoughts on making a bash script to do all that for you? it would ssh into the box and rm cached and save you a few commands each time. – Ajk_P Oct 08 '15 at 01:24
  • @Ajk_P I would like the CI to work in a fully automated fashion, without human interaction. It seems weird to me that git would leave me in a state that needs to be handled by a human, as its automation abilities are usually quite good. – nh2 Oct 08 '15 at 16:30

0 Answers0