When I want to commit sth, in GitHub Desktop or Visual Studio or VS Code, I get this error:
error: Couldn't load public key \\: No such file or directory?
I had tried to use ssh for my github, but now even I can't make a local commit.
Thanks for your help.
CodePudding user response:
[Upgrading my comment to an answer, since it solved the problem.]
If you're getting this message when doing git commit
, which should not try to use ssh, there might be a problem with your Git configuration. Run
git config --list --show-origin
and scan for something to do with a public key, or maybe ssh, and hopefully the problem will jump out at you.
If you find something there, you can edit the file shown and delete the problematic line.
CodePudding user response:
Configure again your access. In my opinion is safest way. Delete all in your ~/.ssh directory and make a new ssh-key.
Once clean up, go again:
ssh-keygen -t rsa -b 4096 -C “[email protected]”
Continue with enter, enter and enter just add a secure pass
Now, see your new files:
ls -al ~/.ssh
And check that the ssh server is on
eval $(ssh-agent -s)
If everything its ok, add your private key
ssh-add ~/.ssh/id_rsa
Now read and copy your public key to add its on your GitHub page config
cat ~/.ssh/id_rsa.pub