2

I have a .ssh folder with my RSA keys, private and public, but when I try to do push in Xcode, it ask me to login in github and to get a token access id.

Why is Xcode ignoring my .ssh folder keys? How to configure it to use the .ssh folder keys?

enter image description here

NullPointerException
  • 36,107
  • 79
  • 222
  • 382
  • I'm having the same situation. I've already checked the remote URLs, and this happens with all the SSH URL types I've tried (git@github.com:user/repo, git@github.com:user/repo.git, ssh://git@github.com/user/repo, and ssh://git@github.com/user/repo.git). – JBYoshi Apr 16 '23 at 22:48

2 Answers2

1

I was able to solve this using some information from https://gist.github.com/brennanMKE/8e09593ca4064deab59da807077d8f53. Specifically, the step:

Add the key to the Keychain with this command.

ssh-add --apple-use-keychain ~/.ssh/id_github

Replace ~/.ssh/id_github with the path to your SSH key (in my case, ~/.ssh/id_rsa), enter your passphrase when prompted, and Xcode should start recognizing the key.

JBYoshi
  • 258
  • 2
  • 6
0

Double-check the remote URL you are using. (you can see it in XCode)

Asking for a GitHUb login and token suggests you are using an HTTPS one.

Only an SSH URL (git@github.com:<user>/<repo>) would make sue of your SSH folder content.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250