In a git repository R I have a submodule that I initialized with the following command:
git submodule add git@mygitserver...
Now a user just cloned R using https
and get an error when running
git submodule init
git submodule update
because he doesn't have ssh (with public key uploaded on the server) access.
So my question is, is it possible to create a submodule that will automatically uses the same protocol than the one used to clone the parent repository on the git submodule update
command ?
That user can set the config:
git config --global url.https://mygitserver/.insteadOf ssh://git@mygitserver/
# or possibly (to be tested)
git config --global url.https://mygitserver/.insteadOf git@mygitserver/
That way, https urls will always be used for mygitserver (main repo or submodules), instead of ssh ones.
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