$ git submodule add <remote_url> <destination_folder>
git submodule add link // add submodule
git submodule update --remote // update submodule
// delete
git rm -r the_submodule
rm -rf .git/modules/the_submodule
submodule init // before you clone a repo
# Submodule is the git feature allowing a repository to include another
# repository, with control on the branch of shared repository that is
# considered by the host repository.
# In order to, for your own application, to create a submodule
# associating the shared repository's main branch, do the following:
"""
git submodule add -b main [URL to Git repo]
git submodule init
"""
# Now you can do
"""
git add .
git commit -m "folder is now a reusable result"
git push
"""
git submodule sync: Updates the description of submodules cached by git in .git/modules
git submodule update --init --recursive --remote for Updates the working copy
[submodule "api"]
path = api
url = https://github.com/<another_repo>/api.git
branch = main
git submodule foreach "git add . && git commit -m 'update' && git push"