When working with password protected ssh keys for git in VS Code on Windows, VS Code by default does not ask for the password
and times out with a permissions denied message. Adding the key to the SSH agent also does not work, since it needs to be started manually.
Of course it can be started in the ~/.profile
or ~/.bashrc
, but that is not helpful for the VS Code issue.
To fix this we can tell git to use the OpenSSH service of Windows and add the key there, that SSH agent can be started automatically under services and will then also work with VS Code. I found this fix somewhere on the internet after some searching but unfortunately lost the post about it, thus decided to write it down myself to avoid struggling with it again in the future.
Note: This short guide only assists in setting up the key to work nicely with VS Code on Windows.