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

I tried ssh -T [email protected] and was successfully authenticated.

this is the error I get when trying to push.

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

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


Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC