Install and set up the GitLab for VS Code extension
To use the GitLab for VS Code extension, install the extension, connect to GitLab, and then configure it as needed.
Install the extension
Choose the installation method that meets your needs:
- For standard VS Code, install from the Visual Studio Marketplace.
- For unofficial VS Code versions, install from Open VSX Registry.
- For secure local development, install in a Visual Studio Code Dev Container.
Install in a Visual Studio Code Dev Container
For added security, set up the extension and use GitLab Duo in a containerized development environment using VS Code Dev Containers.
Prerequisites:
- Docker is installed and running.
- The Visual Studio Code Dev Containers extension is installed in VS Code.
To install the extension in a VS Code Dev Container:
Run the Dev Containers: Add Dev Container Configuration Files command from the Command Palette.
Add the GitLab extension to the configuration file:
// .devcontainer/devcontainer.json { "name": "My Project", "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "customizations": { "vscode": { "extensions": [ "GitLab.gitlab-workflow" ] } } }Run the Dev Containers: Open Folder in Container command to open your project in a VS Code Dev Container. VS Code automatically installs the extension inside the container.