9

I am trying to sync my VSCode with my GitHub so I can commit from VScode, but I get the error

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Not quite sure how to fix this one

Owen
  • 129
  • 1
  • 4
  • `permission denied (publickey)` is usually an error produced by SSH (the protocol over which git communicates). It means that it's looking for your SSH key and is unable to find it. How did you initially clone the repository? Do you get the same error on the command line? – mkasberg Dec 30 '18 at 19:15
  • 2
    no, I only get this error in VScode. I just pushed my project folder into a blank repo. I have no problem committing gitbash. just vscode – Owen Dec 30 '18 at 19:22
  • I have the same issue on Windows 10 when using VSCode (1.39.2). VSCode throws permission error shown above but I can pull/push without issue via command prompt and GitKraken. https://stackoverflow.com/questions/58489695/git-push-working-gitkraken-failing-due-to-permissions-in-vs-code – chonerman Oct 28 '19 at 16:59
  • 1
    If you're on Windows and using ssh, see https://stackoverflow.com/a/72029153/308451 for a detailed explanation of what's going on, which may help you – JBSnorro May 11 '22 at 11:26
  • When you say 'sync my VSCode' do you mean the sync button in the Source Control sidebar menu? This might be the exact problem I had and the link that JBSnorro commented helped me (https://stackoverflow.com/a/72029153/9714002), even tho the exact symptoms weren't the same. I left a comment on that answer to describe my issue too – Douglas Young Jun 14 '22 at 23:40

0 Answers0