Install and set up the GitLab Workflow extension for VS Code
To install the GitLab Workflow extension for VS Code:
- Go to the Visual Studio Marketplace and install and enable the extension.
- If you use an unofficial version of VS Code, install the extension from the Open VSX Registry.
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.
- On the left sidebar, select your avatar.
- Select Edit profile.
- On the left sidebar, select Access tokens.
- Select Add new token.
- Enter a name, description, and expiration date.
- Select the
api
scope. - Select Create personal access token.
Authenticate with GitLab
Then authenticate with GitLab.
- Open the Command Palette:
- For macOS, press Command+Shift+P.
- For Windows or Linux, press Ctrl+Shift+P.
- Type
GitLab: Authenticate
and press Enter. - 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://
orhttps://
. Press Enter to confirm.
- If you enter one manually, in URL to GitLab instance, paste the full URL,
including the
- 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.