It seems odd that you can't use Load Existing Key
to, well, load an ssh key. I’m not the only one to make that mistake... Thanks to Howlger for pointing out the relevant doc here. The correct way to add a key is from the General tab by clicking Add Private Key…
and selecting your ed25519 private key file (not the one ending in “.pub”).
I am fairly new at git, so I'm doing as much of it in the eclipse GUI (aka EGit) as possible. I had already cloned a public repo from the Git perspective like so:
- Clicked
Clone a Git Repository and add the clone to this view
--> GitHub
- Typed org.aspectj in Search box and clicked
Search
- Selected eclipse/org.aspectj and clicked Next
- Selected the master branch --> Next --> entered local directory
- Clicked Finish
The steps are important because EGit defaulted the repo URI for the remote origin
like this: https://github.com/eclipse/org.aspectj
. Now that I had my ssh key loaded, I wanted to change that. So, still in the Git perspective, under Remotes
I right-clicked origin
, clicked Configure push
, then Change…
and clicked the protocol dropdown, selected ssh
and Finish
. Back at the Configure push for remote ‘origin’
window, I clicked Save and Push
and got this error:
Can't connect to any repository: ssh://github.com/eclipse/org.aspectj (ssh://github.com/eclipse/org.aspectj: Cannot log in at github.com:22)
Troubleshooting finally led me to this github documentation about the “git” user . I only needed to update origin’s URI to ssh://git@github.com/eclipse/org.aspectj
and then it worked like a charm.