Setting up a GitHub account on Xcode

After setting up a GitHub account in Xcode, you can access GitHub repositories directly from Xcode.

This article explains how to set up a GitHub account in Xcode.

TOC

Generate the access token

To access GitHub with Xcode, you’ll need an access token. Follow these steps to generate one.

STEP
Open GitHub and sign in.
STEP
Click the account icon in the upper right corner and open “Settings”.
Open the Settings on GitHub
Open the Settings on GitHub
STEP
Open “Developer settings” in Settings.
Developer settings
Developer settings
STEP
Open “Personal access tokens” and click “Generate new token”.
Click "Generate new token"
Click “Generate new token”
STEP
Enter a name in “Note” such as “Xcode” that identifies the location of use, and set an expiration date in “Expiration”.

I set the expiration to “90 days”. If you choose “No expiration”, the token will have no set expiry date. For security reasons, it is better to put an expiration date than an indefinite period.

Enter name and expiration date
Enter name and expiration date
STEP
In the “Select scopes” section, define the operations this access token will be allowed to perform.

Xcode uses this access token, so this operation is allowed from Xcode.

In my case, I checked the following items.

  • admin:public_key
  • write:discussion
  • repo
  • user
  • project

All of these items except project are required by Xcode. Therefore, include the four items other than project.

STEP
Click on “Generate token.
STEP
The generated access token will be displayed, copy and save it.

The access token cannot be displayed again. If you lose it, you’ll need to generate a new token.

Sign in with Xcode

Sign in with Xcode. Operate as follows.

STEP
In Xcode, select “Preferences…” from the “Xcode” menu.
STEP
Open the “Accounts” tab.
STEP
Click on the “+” button in the lower-left corner of the account list.
Add the account
Add the account
STEP
Select “GitHub” on the sheet to select the account type and click the “Continue” button.
Select the GitHub
Select the GitHub
STEP
Enter your account and the access token you generated, then click the “Sign In” button.
Sign in with your account and access token
Sign in with your account and access token
STEP
Return to the “Accounts” tab. If successful, the GitHub account will be added to your account list.
A GitHub account is added.
A GitHub account is added.

Serials List

This article is part of a series called “How to Use Xcode”. For other articles in the same series, open the following links.

How to Use Xcode Serials List

Let's share this post !
TOC