Search code examples
gitgit-submodulespublic-key

How to push a modification on a git submodule without giving username/password


I'm currently trying to deal with git submodules and I'm having trouble when I want to push modifications on children repository.

I get the following error:

fatal: remote error: 
  You can't push to git://github.com/yllieth/ui.git
  Use https://github.com/yllieth/ui.git

Indeed, it's working fine if I change my remote configuration to use HTTPS instead of ssh public key. But I would like to avoid giving my github's username/password.

Is anyone knows some configuration tips or something else to be able to push to a submodule using my public key ?


Solution

  • It's working fine if I change my remote configuration to use HTTPS instead of ssh public key.

    Note that git://github.com/yllieth/ui.git is not an ssh url.
    See "Which remote URL should I use?" and "Changing a remote's URL":

    [email protected]:username/reponame.git would.
    In your case: [email protected]:yllieth/ui.git

    So you still can use ssh, but you need to change the submodule url.