Add a remote repository account

Store your remote repository credentials in Accounts preferences so you don’t have to enter them for each source control action.

To open Accounts preferences, choose Xcode > Preferences and click Accounts.

Add a Bitbucket account

Add a Bitbucket Cloud or Bitbucket Server account.

  1. In the lower-left corner of Accounts preferences, click the Add button (+).

  2. In the sheet that appears, select Bitbucket Cloud or Bitbucket Server, then click Continue.

  3. Enter your account name and password and for Bitbucket Server, also enter the URL.

    For Bitbucket Cloud, app passwords can serve as personal access tokens which provide better security than passwords. To create a Bitbucket Cloud app password, go to Bitbucket Support: App passwords.

    For Bitbucket Server, go to Bitbucket Support: Personal access tokens to create a personal access token.

  4. Click Sign In.

Add a GitHub account

Add a GitHub or GitHub Enterprise account. Xcode will automatically create a personal access token for you.

  1. In the lower-left corner of Accounts preferences, click the Add button (+).

  2. In the sheet that appears, select GitHub or GitHub Enterprise (scroll down the list), then click Continue.

  3. Enter your account name and password, and for GitHub Enterprise, also enter the URL.

  4. Click Sign In.

If you set up two-factor authentication, follow the instructions to authenticate yourself.

Note: To set up two-factor authentication on GitHub.com, edit your Security settings, click Set up two-factor authentication, and follow the instructions.

Add a GitLab account

  1. In the lower-left corner of Accounts preferences, click the Add button (+).

  2. In the sheet that appears, select GitLab.com or GitLab self-hosted (scroll down the list), then click Continue.

  3. Enter your account name and personal access token, and for GitHub Self Hosted, also enter the URL.

    To create a GitLab personal access token, go to GitLab Documentation: Personal access tokens.

  4. Click Sign In.