Skip to content

Instantly share code, notes, and snippets.

@dlford
Created March 8, 2022 21:50
Show Gist options
  • Save dlford/7fbec1e39d6b4639f3272d998b023991 to your computer and use it in GitHub Desktop.
Save dlford/7fbec1e39d6b4639f3272d998b023991 to your computer and use it in GitHub Desktop.
Git Remove Submodule

Remove a submodule from git

git rm .gitmodules # Or edit, if there are some submodules to be kept

edit .git/config, remove the submodule lines, e.g.
  [submodule "cms-core-ops"]
  101   url = [email protected]:dlford/cms-core-ops.git
  102   active = true
  
git rm --cached cms-core-ops

rm -rf .git/modules/cms-core-ops

rm -rf cms-core-ops

git commit -m "removed core ops submodule"

git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment