I was wondering if it is possible to have more than one URL for each git submodule. It would be interested to have more than one source of it if one of them is down or someone is behind a proxy that blocks one of them.
Have you ever had this problem? How would you solve it?
As far as I know, one submodule has only one url, which is referenced in:
.gitmodules
$ cat .gitmodules [submodule "a"] path = a url = /home/moses/subtut/public/a/.git [submodule "b"] path = b url = /home/moses/subtut/public/b/.git
.git
directory of the submoduleMeaning if that url is down, it may have to be changed in those two locations, but I have not tested that process.
Good comments from Gattster
git submodule sync.
According to the docs:
Synchronizes submodules' remote URL configuration setting to the value specified in .gitmodules.
This is useful when submodule URLs change upstream and you need to update your local repositories accordingly.
git submodule sync
" synchronizes all submodules git submodule sync -- A
" synchronizes submodule "A" only.That being said, modifying .gitmodule
might be better done in isolation (i.e. in a branch) until those new url can be validated/published.
I don't believe it is possible. It should be possible to manually do this by checking out your project, initializing your submodules, and then cd into a submodule directory and update the git remote origin to the new repository URL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With