- Add new files to the submodules folder or change existing files.
- Go into the submodules folder.
- The submodule will be in a detached head state, check out the desired branch (ex. master).
- Commit your changes as you normally would.
- Go back to the root directory and commit the changes made to the submodule.
In short:
cd submodule_folder
git checkout master
git add <files>
git commit -m "changes"
cd ..
git add submodule_folder
git commit -m "updated submodule_folder"