Last active
October 4, 2016 15:19
-
-
Save vladskiy/6196dcff215d5aa132cb1edfd8340c54 to your computer and use it in GitHub Desktop.
Remove git submodule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Delete the relevant section from the .gitmodules file. The section would look similar to: | |
[submodule "vendor"] | |
path = vendor | |
url = git://github.com/some-user/some-repo.git | |
2. Stage the .gitmodules changes via command line using:git add .gitmodules | |
3. Delete the relevant section from .git/config, which will look like: | |
[submodule "vendor"] | |
url = git://github.com/some-user/some-repo.git | |
4. Run git rm --cached path/to/submodule . Don't include a trailing slash -- that will lead to an error. | |
5. Run rm -rf .git/modules/submodule_name | |
6. Commit the change: | |
7. Delete the now untracked submodule files rm -rf path/to/submodule | |
Credits: https://davidwalsh.name/git-remove-submodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment