Skip to content

Instantly share code, notes, and snippets.

@TheWiresharkGuy
Forked from myusuf3/delete_git_submodule.md
Last active May 4, 2021 16:44
Show Gist options
  • Save TheWiresharkGuy/ddfd461c165e62adc349ed3ddd30c8e9 to your computer and use it in GitHub Desktop.
Save TheWiresharkGuy/ddfd461c165e62adc349ed3ddd30c8e9 to your computer and use it in GitHub Desktop.
How effectively delete a git submodule.

To remove a submodule you need to:

git submodule deinit <path_to_submodule>
git rm <path_to_submodule>
git commit -m "Removed submodule"
rm -rf .git/modules/<path_to_submodule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment