I cloned a repo using ssh, yet when im trying to push now im getting as public key denied warning

Viewed 42

I tried ssh -T git@github.com and was successfully authenticated.

this is the error I get when trying to push.

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.
1 Answers

Check your current account (id -a on Linux, or set username on Windows), from a Visual Studio Code shell.
Check also HOME (echo $HOME or echo %HOME%), since Git/SSH will look for your key in ~/.ssh

Make sure you are pushing to your own repository (or fork that you own), and not to the remote upstream original repository (that you might not own or be a collaborator of): git remote -v

Related