Xcode/GitHub integration broken

As of yesterday I cannot push/pull from GitHub using Xcode.

I can still push/pull from command line.

I get the error (in Xcode) ERROR:

You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type I am using MacOS 12.2.1 Xcode: 13.2.1

Post not yet marked as solved Up vote post of WorikStanton Down vote post of WorikStanton
5.9k views

Replies

Been suffering through this same exact issue for the past couple hours and finally found a solution:

First, (if you haven't already updated your SSH key) generate a new SSH key using ECDSA with the following command:

 ssh-keygen -t ecdsa -C "your_email"

This should generate two keys id_ecdsa and id_ecdsa.pub

Next, add the SSH key to your github account. Run the following command to copy your new key to clipboard.

 pbcopy < ~/.ssh/id_ecdsa.pub

Then go to GitHub ---> Settings ---> SSH and GPG Keys, and click on New SSH Key. Give your key a relevant title and paste what you copied from your clipboard. Click on Add SSH Key and confirm your password if needed.

Now that you have your new key setup it's time to tell update your Xcode account to use the new key which is not as simple as selecting it from the drop-down for some reason.

Go to Xcode ---> Preferences ---> Accounts.

Highlight your current GitHub account and delete it by tapping the "-" button located in the bottom left of the popup. Then click on Remove to remove the old account.

The issue is selecting the new key from this existing account is not updating Xcode to use the key. So we have to delete it and add the account back.

Next, Tap the "+" button to add a new account.

Select GitHub.

A popup like this should appear.

Then in account enter your GitHub email. Enter your GitHub password if it asks for a password or if it asks for a Personal Access Token do the following:

Go to GitHub ---> Settings ---> Developer Settings ---> Personal Access Tokens, and generate a new token if needed. Otherwise copy the token there and paste it into the Personal Access Token field in Xcode.

Then tap Sign In.

Finally, where it says to Clone Using: make sure to select SSH. Then in the drop-down menu select your new id_ecdsa key.

You're new key should now be working with Xcode Source Control!

  • @pasllani Thanks a lot! It works.

  • Yup this worked for me as well. I had to redo my SSH Key and remove and re-add my Xcode token. A little annoying but it worked.

  • Thanks @pasllani. Works for me.

@pasllani It worked, thanks!

Worked for me too! But for others: Note I had to re-start Xcode before it would use my new key.

Works great. Thank you.

  • This solution fixed my issue as well. Thank you!

Add a Comment