> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GitLab

> Connect Devin to GitLab (versions 15.0 and later) to create merge requests, respond to MR comments, and collaborate in your repositories.

## Why integrate Devin with GitLab?

Integrating Devin with your GitLab repositories allows Devin to create merge requests, read and respond to your MR comments, and collaborate effectively with your team. This lets Devin be a true collaborator on your engineering team.

<Note>
  **Using a self-hosted GitLab instance?** We support GitLab Self-Managed (version 15.0 and later) for users on our Enterprise plan. Simply click the dropdown on the "Connect" button and select **Connect to self-hosted instance**. See the [GitLab Self-Managed Integration guide](/enterprise/integrations/gitlab-self-managed) for full setup instructions.

  The same dropdown also offers **Connect service account**, which connects a GitLab.com service account (or a dedicated user account on the Free tier) with a personal access token that has the `api` scope instead of the OAuth flow below.
</Note>

## Setting up the Integration

**The setup is easy!** Here's how to get started:

1. Create a new GitLab account specifically for Devin (just like you'd create a personal account). You'll use this account, not your personal one, during the integration process.

2. In your Devin account, go to [Settings > **Connections** > **Gitlab**](https://app.devin.ai/settings/connections) and click "Connect".

3. You'll be redirected to GitLab where you should:
   * Log in with the GitLab account you created for Devin (not your personal account)
   * Grant the necessary permissions for Devin to work with your repositories

4. Once completed, you'll return to the Devin settings page where you can confirm the integration is active.

<Warning>
  For GitLab on-premise (self-hosted) installations, the sync of MR status (open, merged, closed) to Devin sessions only happens once a day. This can lead to a temporarily misrepresented MR status in your session or session list until the next sync occurs.
</Warning>

***

## Webhook Configuration

Configuring a webhook allows Devin to automatically receive real-time notifications when specific events occur in GitLab (such as opening or updating merge requests and commenting on merge requests).

To configure the webhook:

1. In your Devin account, go to **Settings** > **Connections** > **GitLab**
2. Click the GitLab connection you want to configure to open its details panel
3. On the **General** tab, click **Configure** in the **Webhook** row
4. Copy the webhook **URL** and **Secret Token** from the dialog
5. Follow the dialog's **Group** (recommended) or **Project** steps to add the webhook in GitLab, selecting the **Comments**, **Merge request events**, **Push events**, **Issues events**, and **Pipeline events** triggers

<Note>
  Adding a webhook in GitLab requires the **Maintainer** role on the project, or the **Owner** role on the group for group webhooks (group webhooks are available on GitLab Premium and Ultimate). When automatic webhook setup is available for your organization, the dialog notes that Devin sets up webhooks on every project and group its GitLab account can administer; use the manual steps only for projects it cannot reach.
</Note>

Once configured, Devin will be able to respond to GitLab events in real time rather than relying on periodic polling.

***

## Repository Permissions

### For Core and Teams users

Once the integration is configured, you can @mention repositories directly in your prompts within the Devin web application.

### For Enterprise users

Once the integration is configured, you can delegate repositories to specific organizations from [**Settings** > **Repositories**](https://app.devin.ai/settings/repositories).

1. Select the organization from the dropdown at the top of the page
2. Click **Manage permissions**
3. Add the relevant groups or repositories with **Read & write** or **Read only** access

See [Repository Permissions](/enterprise/integrations/git-integrations#repository-permissions) for details.

<Note>
  If repositories do not appear immediately after connecting, Devin refreshes the repository list periodically. You can manually refresh the repository list in Devin.
</Note>

***

## User Linking

On top of the organization-wide connection, individual users can link their own GitLab account to Devin so that Devin can act under their identity for GitLab operations, such as opening merge requests as the linked user when **Open PRs as** is set to **User** or **User only** under [**Settings** > **Devin**](https://app.devin.ai/settings/devin) > **Pull requests**.

To link a personal GitLab account:

1. Ensure you are a member of a Devin organization whose GitLab integration is set up
2. Go to [Settings > **Connections**](https://app.devin.ai/account/connections) in your personal account settings
3. Find the **GitLab** row and click **Link**, then complete the GitLab authorization

<Note>
  **Personal Connections only shows integrations for organizations the user belongs to.** The **GitLab** row appears when your organization has a GitLab.com connection. Self-hosted GitLab instances (Enterprise plan) appear as separate **Self-hosted GitLab** rows labeled with the host, and are linked the same way. If no GitLab row appears, confirm that you are a member of a Devin organization with a GitLab connection.
</Note>

***

## Using Devin with the GitLab Integration

After connecting GitLab, set up your repositories on [Devin's Machine](https://app.devin.ai/machine).

<Note>
  **How Devin responds to MR comments.** Once the [webhook](#webhook-configuration) is configured, a comment on a merge request that a Devin session is tracking is delivered to that session in real time. By default, this wakes a sleeping session and Devin responds to the comment.

  To limit this, an organization admin can turn on **Require @Devin to respond** under [**Settings** > **Devin**](https://app.devin.ai/settings/devin) > **Pull requests**. With that setting enabled, Devin only wakes and responds to comments that start with `@Devin` or `Devin` as a whole word, such as `Devin fix this` (the `devinai` prefix is also accepted). Matching is case-insensitive.

  Comments that contain `(aside)` or `!aside`, or that start with `aside`, are always ignored regardless of this setting, so you can discuss the MR without waking Devin.

  Without a webhook, MR comments are not delivered to the session in real time; Devin can still address them if you point them out directly in the session.
</Note>

## Best Practices

* Create a dedicated GitLab account for Devin
* Enable branch protections on main/master branches
* Configure the webhook for real-time event notifications

## Support

1. Create a Slack connect channel with our team at [app.devin.ai/settings/support](https://app.devin.ai/settings/support)
2. Share session links when reporting issues and provide screenshots


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.