The URL that .gitmodules normally uses only when initializing submodules or on git submodule sync . During initialization ( git submodule init ), the URL is placed in the .git/config repository, and when the submodule is cloned into place (on git submodule update ), the URL to be used is taken from the config. The only time a .gitmodules used is when you run git submodule sync , which similarly updates the URL in the config, and also removes the origin remote in the submodule with the same URL.
This means that you will not have problems checking an earlier commit and running git submodule update - the remote origin in your submodule will not be changed when checking for a new commit in the parent repository.
source share