Permission denied (public key). fatal: Could not read from remote repository
As a programmer, you may encounter many errors. First, you have to read the error message carefully. Because error messages usually tell you what to do to get rid of this.
When you get the error message from your git CLI, this means your local machine has a problem with Github's shh keys so the solution is:
- Open the .git folder in your project directory(it's a hidden folder so make sure to check that you are able to view hidden files and folders on your computer)
- Open config file using notepad or your favorite code editor
- Here you will edit the line with url = email@example.com:username/repo and replace it with your repository URL(can be found on Github under https when you click the green “code” button). it should look like this url = https://github.com/username/repo save then try to push your code to GitHub. this will prompt you to log in and that should fix the issue since your ssh keys have been updated.