We have port 9418 blocked here so I can't seem to clone with git://xyz.git
Is there a way to make git use HTTP instead? If I do it manually it works but when I run git submodule update it always wants to use git:
You need to change the configuration variable submodule.<submodule-name>.url
for each submodule, e.g.:
git config submodule.whatever.url http://github.com/nvie/shFlags.git
Then when you do git submodule update
, the git fetch
which is run in that submodule will use the URL from that configuration variable.
If you want to change origin
in that submodule, you'll need to take some separate steps:
cd whatever
git remote rm origin
git remote add origin http://github.com/nvie/shFlags.git
... but if you're not actively working in that submodule, you don't have to worry about that.
The .gitmodules
file is just used to set the submodule.<submodule-name>.url
variable when you initialize the submodule. It's not worth changing unless you want to push a new version of the .gitmodules
file, and it's good policy to make sure that URLs in the .gitmodules
file are accessible to everyone who might clone it (e.g. typically you wouldn't commit a .gitmodules
file with SSH URLs.)
This depends on how the submodules are registered. You must edit the file .gitmodules
before git submodules init
.
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