Skip to content

Instantly share code, notes, and snippets.

@jeliasson
Last active February 21, 2020 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeliasson/dade6a4ff64e1cbc9f11227c707a6650 to your computer and use it in GitHub Desktop.
Save jeliasson/dade6a4ff64e1cbc9f11227c707a6650 to your computer and use it in GitHub Desktop.
Remove Git Sub-module

Remove Git Sub-Module

  1. Remove sub module section from the .gitmodules file.
nano .gitmodules
  1. Stage the change
git add .gitmodules
  1. Remove sub module section from the .git/config file.
nano .git/config
  1. Remove git cache
git rm --cached submodule-path`
  1. Remove git module files:
rm -rf .git/modules/submodule-path
  1. Commit changes
git commit -m "Removed submodule"
  1. Delete untracked submodule files:
rm -rf submodule-path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment