Did you wonder why are are getting Could not read from remote repository error conecting from your PC, this usually happend when we start working on a new pc or just a fresh configuration … you try to clone you nice code from your repo and POW !
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Start by having a nice git client installed, I recomment https://git-scm.com/downloads/win since it add the “Open Git Bash Here” option to the right click on Windows. Warning Windows 11 have that option hidden under “Show more options”
If you are like my and prefer the Classic Menu Content follow this steps otherwise skip this steps
- Open a Command Prompt Window
- Type the next command and click Enter
reg.exe add “HKCU\Software\Classes\CLSID{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32” /f /ve - Restart File Explorer, you have two options: a) From Task Manager find Windows Explorer, right click it and select restart. b) Or restart your PC
- If you are not happy with the change you can reset it back to the new Moderm Context Menu
Type the next command at a Command Prompt Window and click Enter
reg.exe del “HKCU\Software\Classes\CLSID{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\” /f
* reference answers.microsoft.com restore-old-right-click-context-menu-in-windows-11
Back to bussines, add SSH to fix the error and get remote access
- Open Git Bash window
- Generate the key, paste the text below, replacing the email used in the example with your GitHub email address.
sh-keygen -t rsa -b 4096 -C "your_email@example.com" - Copy the key on you clipboard
clip < ~/.ssh/id_ed25519.pub - Login to your GitHub account,
- Click you avatar, select SSH and GPG keys,
- Click New SSH key and paste it 🙂
*reference and detailed steps:
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
