Bitbucket Authentication for Xcode

My client uses Bitbucket as the repository for his project. Bitbucket recently disallowed account/password authentication and instead requires SSH keys. I can't find any documentation (either on Apple's or Bitbucket's sites) on how to make this change for Xcode. Does anyone have any experience with this? At the moment, I can't push any changes into the repository, and I'm afraid that matters will only get worse.

You should be able to make it switch to SSH by cloning the repository again but checking it out over SSH instead.

  1. Go to Bitbucket
  2. Find the repo you want to clone, and click the Clone button. If you're on Bitbucket Cloud it's at the top right, if you're on Bitbucket Server / Datacenter it's at the top left.
  3. Make sure the Clone screen is set to SSH (not HTTPS).
  4. Copy the repository URL but miss off the 'git clone' part if it's there. The part you want looks like git@bitbucket.org:username/repo.git
  5. On the Xcode splash screen choose 'Clone an existing project'
  6. Paste the thing you copied into the 'Enter Repository URL' box at the very top of the popup.

Note you'll need to have added your Mac's SSH key to your user preferences in Bitbucket first:

  1. If the file ~/.ssh/id_rsa.pub exists on your machine, copy the contents. This is your public ssh key.
  2. If that file doesn't exist, first generate it with ssh-keygen in a terminal.
  3. Paste it into Bitbucket -> Your avatar -> Personal settings -> SSH Keys -> Add Key

Thank you for your response. I eventually found an alternative solution at  https://bitbucket.org/blog/deprecating-atlassian-account-password-for-bitbucket-api-and-git-activity.

Essentially, all I needed to do was to create an app password and enter it into the Xcode account for the Bitbucket repository. This seems to be the least disruptive solution, but I was unable to find it during my first search into the Bitbucket literature.

Bitbucket Authentication for Xcode
 
 
Q