csriig
Last Updated: February 25, 2016
·
10.77K
· santiagogil

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...

4 Responses
Add your response

1642

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

@mindjiver Intresting. Thanks!

over 1 year ago ·
1889

Why subprojects have to be so difficult...

over 1 year ago ·
Filed Under