2

I have a project with a submodule configured. It uses a relative path, so it should be checked out via ssh (because I cloned the parent project with ssh).

I did: git submodule update --init --recursive --remote

and the error is on Windows Powershell: Permission denied

I think I also found the reason for this. My ssh key is protected with a password. So powershell should ask me for the password as it does when using git clone. But apparently it does not.

So I got a few workarounds:

  • Use git bash on Windows (asks me for the passsword and thus works perfectly)
  • Don't use a password for ssh
  • Don't use ssh

All workarounds are not ideal. So I wonder: Is this a known issue / limitation? Can I do anything about this?

Leon0402
  • 160
  • 1
  • 9

1 Answers1

0

If those submodules are using an SSH URL (check your .gitmodules), then you can try and use an ssh-agent in your Powershell session.

Test it with ssh -Tv remoteUser@remoteServer (for GitHub remote repositories, that would be ssh -Tv git@github.com)

The first query should ask for your SSH passphrase, but after that, you should be able to clone/submodule update without any more prompt.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250