DEV Community

ochieng seth
ochieng seth

Posted on • Updated on

Permission denied (publickey). fatal: Could not read from remote repository.

When you get this error from your git cli, this means your local machine has a problem with github's shh keys so the solution is:

  1. Open the .git folder in your project directory(its a hidden folder so make sure to check that you are able to view hidden files and folders on your computer)
  2. Use your favorite text editor like vscode to open the file named config
  3. edit the line with url = git@github.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 login and that should fix the issue since your ssh keys have been updated. Cheers Also, chat on twitter

Top comments (0)