git:git-full-remove-submodules
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
git:git-full-remove-submodules [2024/05/28 14:27] – admin | git:git-full-remove-submodules [2025/03/25 17:10] (current) – admin | ||
---|---|---|---|
Line 15: | Line 15: | ||
url = https:// | url = https:// | ||
</ | </ | ||
- | Remove git tracking of the submodul | + | Remove git tracking of the submodule |
<code bash> | <code bash> | ||
- | git rm -r external/ | + | git rm --cached |
</ | </ | ||
Remove the submodule from git config (all variables are remove using section) : | Remove the submodule from git config (all variables are remove using section) : | ||
Line 23: | Line 23: | ||
git config --remove-section submodule.external/ | git config --remove-section submodule.external/ | ||
</ | </ | ||
- | stage the changes in .gitmodules | + | stage and commit |
<code bash> | <code bash> | ||
git add .gitmodules | git add .gitmodules | ||
+ | git commit -m " | ||
</ | </ | ||
+ | Remove the submodules from .git/ | ||
+ | <code bash> | ||
+ | rm -rf .git/ | ||
+ | </ | ||
+ | Finally, push the changes to the remote repo | ||
+ | <code bash> | ||
+ | git push | ||
+ | </ | ||
+ | Note that the files are still on the host, to remove them just use rm : | ||
+ | <code bash> | ||
+ | rm -rf external/ | ||
+ | </ | ||
+ | |||
+ | |||
git/git-full-remove-submodules.1716899258.txt.gz · Last modified: 2024/05/28 14:27 by admin