Your main project points to a particular commit that the submodule should be at. git submodule update
tries to check out that commit in each submodule that has been initialized. The submodule is really an independent repository - just creating a new commit in the submodule and pushing that isn't enough. You also need to explicitly add the new version of the submodule in the main project.
So, in your case, you should find the right commit in the submodule - let's assume that's the tip of master
:
cd mod
git checkout master
git pull origin master
Now go back to the main project, stage the submodule and commit that:
cd ..
git add mod
git commit -m "Updating the submodule 'mod' to the latest version"
Now push your new version of the main project:
git push origin master
From this point on, if anyone else updates their main project, then git submodule update
for them will update the submodule, assuming it's been initialized.