User Tools

Site Tools


git:git-full-remove-submodules

This is an old revision of the document!


Back to git main page

If you want to fully remove a submodule, the following things have to done :

  • remove the submodule entry from the .gitmodules file in the root of the main git repo
  • remove the variables associated to the submodule
  • remove the description in ./git/modules folder
  • remove the folder containing the submodule

Assume that the submodule is called submod and that it's path relative to the root of the git repo is external/gits

Open a terminal in the root of the git repo, and edit the .gitmodules file to remove the entry

[submodule "external/gits/submod"]
path = external/gits/submod
url = https://github.com/user/submod.git

Remove git tracking of the submodul folder :

git rm -r external/gits/submod

Remove the submodule from git config (all variables are remove using section) :

git config --remove-section submodule.path/to/submodule
git/git-full-remove-submodules.1716899189.txt.gz · Last modified: 2024/05/28 14:26 by admin