This apparently is very much dependent on the version of git you are using.
- If present, change the
url
entry in the[submodule "<dirname>"]
section of the.gitmodules
file. - If present, change the
url
entry in the[submodule "<dirname>"]
section of the.git/config
file. - Change the
url
in the configuration of the submodule itself. The location of theconfig
file is version dependent. Older versions had it in<dirname>/.git/config
, newer ones in.git/modules/<dirname>/config
. However, you can always use below command:
cd <dirname>
git config remote.origin.url <new_url>