Setting up a GitLab account on Xcode

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

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


Generate a personal access token

To access GitLab from Xcode, you need a personal access token. Follow these steps to generate a personal access token.

(1) Sign in to GitLab, click on your avatar icon in the upper right corner, and select “Edit Profile.

Open the "Edit Profile"
Open the “Edit Profile”

(2) Open “Access Tokens” in “User Settings”.

Open the "Access Tokens"
Open the “Access Tokens”

(3) Enter a name in the “Token name” field, such as “Xcode” that identifies the purpose of use.

(4) Enter the token’s expiration date in the “Expiration date” field.

By default, this field is left blank. If left blank, the expiration date will be indefinite.

(5) Set the permissions to be granted in the “Select scopes” section.

Set the permissions to be granted in the “Select scopes” section.

  • api
  • read_user
  • read_api
  • read_repository
  • write_repository
Set the permissions to be granted
Set the permissions to be granted

(6) Click on “Create personal access token”.

(7) The generated access token will appear under “Your new personal access token”. Ensure to copy and save it.

Remember, personal access tokens cannot be redisplayed. If lost, deactivate the old token and generate a new one.

Setting up an account with Xcode

Follow the steps below to set up an account in Xcode.

(1) In Xcode, select “Preferences…” from the “Xcode” menu.

(2) Open the “Accounts” tab.

(3) Click on the “+” button in the lower-left corner of the account list.

Add an account
Add an account

(4) Select “GitLab self-hosted” to connect to the enterprise and community versions of GitLab; select “” to connect to the SaaS version hosted at

Select GitLab
Select GitLab

(5) Click the “Continue” button.

(6) Enter the URL in “Server,” the account in “Account,” and the personal access token in “Token,” then click the “Sign In” button.

Only the Enterprise and Community editions display the ” Server ” field.

Enter connection information
Enter connection information

(7) Once you return to the “Accounts” tab, you should see the account you entered added to the list.

An GitLab account is added
An GitLab account is added


Authored Books

  • URLをコピーしました!
  • URLをコピーしました!


Akira Hayashi (林 晃)のアバター Akira Hayashi (林 晃) Representative(代表), Software Engineer(ソフトウェアエンジニア)

アールケー開発代表。Appleプラットフォーム向けの開発を専門としているソフトウェアエンジニア。ソフトウェアの受託開発、技術書執筆、技術指導・セミナー講師。note, Medium, LinkedIn
Representative of RK Kaihatsu. Software Engineer Specializing in Development for the Apple Platform. Specializing in contract software development, technical writing, and serving as a tech workshop lecturer. note, Medium, LinkedIn