a concise shot of dev knowledge
Become a Contributor
Concise shots of dev knowledge

RELATED TAGS

git
submodule
communitycreator

How to delete a Git submodule

Anjana Shankar

Git submodules are a powerful way to use Git as an external dependency management toolThis is analogous to creating a soft link on your system.. This shot covers what needs to be done when you delete a project that has a submodule in it.

There are four steps involved when you delete a submodule.

1. deinit the submodule

git submodule deinit <submodule_directory>

2. Remove the submodule directory from Git

git rm <submodule_directory>

3. Remove the submodule directory from .git/modules/

rm -rf .git/modules/<submodule_directory>

4. commit and push the changes

git commit -m"Removed Submodule"
git push

RELATED TAGS

git
submodule
communitycreator
RELATED COURSES

View all Courses

Keep Exploring

Learn in-demand tech skills in half the time

Copyright ©2022 Educative, Inc. All rights reserved.

soc2