Skip to main content

Integrating with GitLab

Deploy to and from your hosted GitLab source control provider using Gearset

Valerio Chang avatar
Written by Valerio Chang
Updated this week

Connecting to your source control repository with Gearset allows you to deploy to and from your source of truth. This article shows you how simple it is to connect to your cloud-based repo on GitLab.

If your GitLab repository is not on the URL https://gitlab.com/, it's likely you have an on-premise or a Dedicated instance. See Integrating with self-managed GitLab to guide you through that process.

To connect to your GitLab account to Gearset, head to the Source control and services page.

You have two options to connect to GitLab either using OAuth or using an Access token.



OAuth Connections

To connect via OAuth click + Connect to GitLab via OAuth this will take you to GitLab's OAuth page for authentication.

Double-check that your organization has given us access to your repo. You may see the error "Gearset can't find any repositories" which likely means you must request access from the repository owner(s). Once you are ready to proceed, click Authorize and type in your password.

Once complete, it should look like this (with your authenticated GitLab username being visible):

Additionally, your GitLab applications settings should list Gearset as an authorized app. Here, you have the ability to revoke the application at any time. You can follow the link above, or click on your Profile image in Gitlab, select Preferences from the dropdown. Then you can find the Applications menu.


Access Token Connections

We support setting up GitLab connections using Group, Personal and Project Access Tokens that have been created in GitLab.

  • User connections are restricted to using Personal Access Tokens. This is because we will perform VCS actions as the VCS user performing the action to keep an audit trail.

  • We recommend using Group or Project Access Tokens for Team connections, however you can also use a Personal Access Token here as well.

Personal Access tokens can be created in your GitLab User Settings -> Personal Access Tokens

Group and Project Access Tokens can normally only be created with increased privileges. Contact your Admin or Maintainer if these need to be created.

Access Tokens should be created with the same permission scope as OAuth connections. When creating the Token check the api scope.


To connect via Access Token click + Connect to GitLab via Access Token this will bring up a modal where you can enter the Access Token you wish to use.

Access tokens are a direct link to your repository and therefore do not go through the same flow as OAuth.

Personal Access Tokens will act as the user that created them and will have the same access to the same Groups and Projects as this user.

Project and Group Access Tokens create a non-seat using bot user in the background when they are created in GitLab and will have a defined scope e.g.

  • Group Access Tokens will have access to all Projects in a Group.

  • Project Access Tokens will only have access to a single Project

Did this answer your question?