Permission denied when pushing to repo?

Hi, I am trying to push some new code to my repo and I get the following error. I am using VSCode and Remote Development. The project was created around Spring 2022 so it’s not that old. It’s a Larvel project. It’s deploy on Digital Ocean. I tried adding a new ssh key to github and that didn’t fix my issue.

I would appreciate any help.

git 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.

Hello!

You added the public key to your repo, but did you change it on VSCode? See this if you haven’t.

Maybe your repo is private? If your repo is private the HTTP link won’t allow you to clone your repo. Try using SSH link to clone and see if it works.

Thanks everyone I was able to fix my issue. I forgot that the key I generated wasn’t done on my local computer but on the remote server. I looked for it on my server and added it to github and now it’s fine