Install and set up the GitLab Workflow extension for VS Code

To install the GitLab Workflow extension for VS Code:

Connect to GitLab

After you download and install the extension, connect it to your GitLab account.

Create a personal access token

If you are on a self-managed GitLab instance, create a personal access token.

  1. On the left sidebar, select your avatar.
  2. Select Edit profile.
  3. On the left sidebar, select Access tokens.
  4. Select Add new token.
  5. Enter a name, description, and expiration date.
  6. Select the api scope.
  7. Select Create personal access token.

Authenticate with GitLab

Then authenticate with GitLab.

  1. Open the Command Palette:
    • For macOS, press Command+Shift+P.
    • For Windows or Linux, press Ctrl+Shift+P.
  2. Type GitLab: Authenticate and press Enter.
  3. Select your GitLab instance URL from the options, or enter one manually.
    • If you enter one manually, in URL to GitLab instance, paste the full URL, including the http:// or https://. Press Enter to confirm.
  4. Authenticate with GitLab. For GitLab.com, you can use the OAuth authentication method. If you don’t use OAuth, use a personal access token.

The extension matches your Git repository remote URL with the GitLab instance URL you specified for your token. If you have multiple accounts or projects, you can choose the one you want to use. For more details, see Switch GitLab accounts in VS Code.

The extension shows information in the VS Code status bar if both:

  • Your project has a pipeline for the last commit.
  • Your current branch is associated with a merge request.

Configure the extension

To configure settings, go to Settings > Extensions > GitLab Workflow.

By default, Code Suggestions and GitLab Duo Chat are turned on, so if you have the GitLab Duo add-on and a seat assigned, you should have access.