csriig
Last Updated: February 25, 2016
·
8.409K
· santiagogil
78bc637668cd4524f548a22f2ddf31dc

Remove a git submodule

To remove a submodule you need to:

  • Delete the relevant line from the .gitmodules file.
  • Delete the relevant section from .git/config.
  • Run git rm --cached pathtosubmodule (no trailing slash).
  • Commit the superproject.
  • Delete the now untracked submodule files.

Source(s): GitSubmoduleTutorial : https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial

Must find a simpler way...

Say Thanks
Respond

4 Responses
Add your response

1642
4e2db9197c36a702219a46a79c024fd0

I didn't found other way. It's the only.
You can write script to do it.

over 1 year ago ·
1643

There is a topic-branch in git.git for git-submodule-rm, http://comments.gmane.org/gmane.comp.version-control.git/209755

over 1 year ago ·
1647
78bc637668cd4524f548a22f2ddf31dc

@mindjiver Intresting. Thanks!

over 1 year ago ·
1889
Photo on 08.01.2013 at 04.15

Why subprojects have to be so difficult...

over 1 year ago ·
Filed Under