Setting up a GitLab account on Xcode

Once you have set up a GitLab account in Xcode, you can access GitLab repositories directly from Xcode.

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

TOC

Generate a personal access token

To access GitLab from Xcode, you need a personal access token. Generate a personal access token by doing the following.

STEP
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”
STEP
Open “Access Tokens” in “User Settings”.
Open the "Access Tokens"
Open the “Access Tokens”
STEP
Enter a name in the “Token name” field such as “Xcode” that identifies the purpose of use.
STEP
Enter the expiration date of the token in the “Expiration date” field.

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

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

In my case, I turned on the following permissions, excluding sudo.

  • api
  • read_user
  • read_api
  • read_repository
  • write_repository
Set the permissions to be granted
Set the permissions to be granted
STEP
Click on “Create personal access token.
STEP
The generated access token will appear in “Your new personal access token”; copy and save it.

Personal access tokens cannot be redisplayed, so if you lose track of them, please deactivate them and generate a new personal access token.

Setting up an account with Xcode

Set up an account in Xcode.

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 an account
Add an account
STEP
Select “GitLab self-hosted” to connect to the enterprise and community versions of GitLab; select “GitLab.com” to connect to the SaaS version hosted at GitLab.com.
Select GitLab
Select GitLab
STEP
Click the “Continue” button.
STEP
Enter the URL in “Server,” the account in “Account,” and the personal access token in “Token,” then click the “Sign In” button.

The “Server” field is only displayed for the Enterprise and Community editions.

Enter connection information
Enter connection information
STEP
Return to the “Accounts” tab and the account you entered will be added.
An GitLab account is added
An GitLab 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