1

I want to remove a git submodule. I found another question that answers how to do it but I had questions about the process.

In my knowledge, removing the reference from .gitmodules should remove it from .git/config as well as I see that .git/config (in the the top level) gets updated on running "git submodule init". So, why can't I just remove from .gitmodules and git rm --cached ?

Another question is that when I did that(just remove from .gitmodules), on running git submodules init, I see a failure as git tries to initialize the submodule that I want to remove.

I understand this is a process and this is how it is but if someone can give some more info. on it, it would be great. I have googled on it and also seen similar questions on stackoverflow.

SeattleOrBayArea
  • 2,808
  • 6
  • 26
  • 38
  • I'm sure you saw this SO answer: http://stackoverflow.com/questions/1260748/how-do-i-remove-a-git-submodule I really wish git would add a `git submodule rm` command, seeing as people have been using this silly 5-step process since at least 2009 and the question has 450 upvotes. – danny Apr 19 '12 at 18:11

2 Answers2

0

One way to simplify the process of removing a submodule is to use the new git1.8.3 (April 22d, 2013) command:

git submodule deinit

See the new answer in "How do I remove a Git submodule?".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
-1

I think it is just the way it is, could not get any answers so marking this as the right one to close it.

SeattleOrBayArea
  • 2,808
  • 6
  • 26
  • 38