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 GitLab Self-Managed, 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 enabled, so if you have the GitLab Duo add-on and a seat assigned, you should have access.
Code security
To configure the code security settings, go to Settings > Extensions > GitLab Workflow > Code Security.
- To enable SAST scanning of the active file, select the Enable Real-time SAST scan checkbox.
- Optional. To enable SAST scanning of the active file when you save it, select the Enable scanning on file save checkbox.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support