git clone --recurse-submodules [address_project_repository.git]
If the repository was already cloned without the --recurse-submodules
option, the submodules can be initialized and updated with:
git submodule update --init --recursive
cd /path_to_wordpress
git submodule add [address_plugin_repository.git] wp-content/plugins/[folder_plugin_name]
git submodule update --init --recursive
git add .gitmodules wp-content/plugins/[folder_plugin_name]
git commit -m "Added [folder_plugin_name] as submodule"
cd wp-content/plugins/[folder_plugin_name]
git pull origin main
cd ../../../
git add wp-content/plugins/[folder_plugin_name]
git commit -m "Updated [folder_plugin_name] submodule"
git config -f .gitmodules --remove-section submodule.wp-content/plugins/[folder_plugin_name]
git config -f .git/config --remove-section submodule.wp-content/plugins/[folder_plugin_name]
rm -rf .git/modules/wp-content/plugins/[folder_plugin_name]
rm -rf wp-content/plugins/[folder_plugin_name]
git add .gitmodules
git rm -r wp-content/plugins/[folder_plugin_name]
git commit -m "Removed [folder_plugin_name] submodule"