0

I have created a private git repo on github. I ran the commands ssh-keygen -t ed25519 -C "me@gmail.com" -f ".\id_ed22519_me" and ssh-add .\id_ed22519_me to create the private and public keys, and added the public ssh key to github. I also have setup the following config to use the correct keys:

#~/.ssh/config
Host github.com-me
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed22519_me
  IdentitiesOnly yes

However when I try to use the git command I get the following error:

#powershell
PS C:\Path\to\Project> ssh -T git@github.com
   Hi me! You've successfully authenticated, but GitHub does not provide shell access.

PS C:\Path\to\Project> git push --set-upstream origin master
   git@github.com: Permission denied (publickey).
   fatal: Could not read from remote repository.

   Please make sure you have the correct access rights
   and the repository exists.

Can anyone know what could lead to that? I also have made sure that I use the correct url for the remote "origin", and that my branch is indeed "master"

K.N.
  • 1
  • 1

1 Answers1

0

https://gist.github.com/jexchan/2351996#gistcomment-522294 This appears to resolve my issue. I'm a bit weirded out that I have to append my username to the URL, but it works ^^

K.N.
  • 1
  • 1
  • there is also this https://stackoverflow.com/questions/7927750/specify-an-ssh-key-for-git-push-for-a-given-domain – K.N. Dec 11 '20 at 21:32