I'm trying to use a submodule in my Android application, and while I was able to add the submodule successful, when trying to commit a change to use the latest version of that submodule, it throws an error.
The submodule is a simple repo that just contains json data that multiple applications are using.
I navigated to the assets directory within my Android app, and added the submodule like normal and gave it an alias "database"
git submodule add https://github.com/.... database
Now, that works but when I updated the submodule, I'm unable to commit the change within my main repo saying "use the the latest version of that submodule"
my_app\src\main\assets\database
"-" Subproject commit 3521bd386c99....
"+" Subproject commit d135dc8cd5b0....
"d135dc8cd5b0...." being the latest version of that submodule.
If I try to commit that change, it'll throw this error.
Could not commit submodules:
my_app/src/main/assets/database
Add them as submodules from Git Shell or remove their .git folders
and add them as a regular directories instead.
But I already added it as a submodule through the Git Shell. Any idea on how to fix this?
Thanks.
You should be able to commit the updated submodule if you commit it all by itself using its directory path:
You should then be able to commit all the other changes you have made to your repository: