Clone repository with submodule
1 | git clone --recursive <repo_url> |
Clone submodules after repository cloned
1 | git submodule init |
Add submodule
1 | git submodule add <submodule_clone_url> <submodule_folder> |
Remove submodule
Step1 - Remove submodule folder
1 | git rm --cached /path/to/submodule |
Step2 - Remove submodule config in .gitmodules
1 | -[submodule "themes/next"] |
Update submodule to latest commit
Step1 - Checkout the target version of the submodule
1 | # Go to the submodule folder |
Step2 - Commit the update
1 | # Back to the parent folder |