1

I installed git version as written here https://github.com/microsoft/vscode/issues/44244#issuecomment-368250055. I do teams sign in in VS code but still doesn't work. Over git bash everything is working OK. I can commit, pull, push to devops repo, but over VS code, I can commit changes and I can see branches, but once I want to push my changes to devops I get an error :

Permission denied, please try again. Permission denied, please try again. git@ssh.dev.azure.com: Permission denied (password,publickey). fatal: Could not read from remote repository.

Then I go again to git, write git push, put my password for keys and my commited changes in VS code are pushed to devops. Any hint, tips, whatever?

Thank you

Dave
  • 241
  • 1
  • 11
kubinho20
  • 11
  • 1

1 Answers1

0

To know more about this error, launch code (VSCode) from a shell session where you have set GIT_SSH_COMMAND to ssh -v.

You can then use the VSCode command: "Git: Show Git output" to see exactly what your ssh call is doing on git pull/push within VSCode.

microsoft/vscode issue 100774 mentions:

Resolved by forcing GIT to use Win32 OpenSSH instead, through GIT_SSH_COMMAND

So check which ssh is used in your case (ssh -v will show you that, as I did here)

If you have a private key protected by a passphrase, see How can I use Windows' built-in OpenSSH ssh-agent in VS Code, instead of Git bash's?, and check the remote.SSH.path setting.

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • I followed "If you have a private key protected by a passphrase, see How can I use Windows' built-in OpenSSH ssh-agent in VS Code, instead of Git bash's?, and check the remote.SSH.path setting." but no change. I am using passphrase so i did it, but stil doesnt work. – kubinho20 Jan 19 '21 at 09:20
  • @kubinho20 Are you on Windows? With the latest Git? – VonC Jan 19 '21 at 12:03
  • Yes windows 10, git version 2.28.0.windows.1 – kubinho20 Jan 19 '21 at 13:19
  • @kubinho20 Can you update Git to 2.30, and then launch vscode from a CMD with a simplified PATH, as shown in https://stackoverflow.com/a/58254413/6309? (for testing) – VonC Jan 19 '21 at 13:22
  • updated, but nothing. Btw i tried in VS 2019 and works fine. At least i have to on the push or pull every time putting passphrase for SSH connection , but at least do working. VS code nope.. Any other idea please? – kubinho20 Jan 20 '21 at 08:06
  • Looks like problem is, that field where should i put passphrase doesnt appear, so thats i dont have a permission to do pull or push – kubinho20 Jan 20 '21 at 08:35
  • @kubinho20 Can you try with a private key *not* protected by a passphrase, for testing? – VonC Jan 20 '21 at 08:38
  • Have some guidance how to not protect private key with passphrase if its already protected? – kubinho20 Jan 21 '21 at 08:40
  • @kubinho20 Yes: https://stackoverflow.com/a/58052425/6309 – VonC Jan 21 '21 at 08:42