Setting up a GitHub account on Xcode

Once you set 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 need an access token. Operate as follows.

STEP
Open GitHub and sign in.
STEP
Click on 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 selected 90 days as “90 days”. If you select “No expiration” it will be indefinite. 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 “Select scopes” section, set the operations to be allowed for this access token.

This access token is used by Xcode, 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, be sure to 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 redisplayed. If you are unsure, 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 for selecting 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 !

    Author of this article

    Akira Hayashiのアバター Akira Hayashi Representative, Software Engineer

    I am an application developer loves programming. This blog is a tech blog, its articles are learning notes. In my work, I mainly focus on desktop and mobile application development, but I also write technical books and teach seminars. The websites of my work and books are here -> RK Kaihatsu.

    TOC