Can't clone or push into my GitHub repository using SSH from VS Code terminal and the default windows terminal

18 views Asked by At

When I try to clone into a repo from the default windows terminal and vscode terminal It says

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

It appears that when I generate a keypair through git bash and add it to github, ssh seems to work fine. It shows public key error only in the default windows terminal and vscode terminal. And when I list the added keys using ssh-add -l the key in the git bash terminal isn't showing up on the windows or the vscode terminal and vice versa.

I tried removing all the previous keys both from github and the ssh agent and tried using new ones but still I get this error.

I am able to run git bash on vscode terminal but the PIDs of the ssh agent running on the vscode and the default git bash terminal are different.

I am running the default windows ssh client. I think the Git Bash terminal and the windows and vscode terminals are using different ssh agents and if so, Can I make them use the same ssh agent.

0

There are 0 answers