Text of docs.lovable.dev › integrations › gitlab as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Sync your Lovable project with GitLab - Lovable Documentation

Documentation Index Fetch the complete documentation index at: /llms.txt Use this file to discover all available pages before exploring further. Skip to main content Assistant Responses are generated using AI and may contain mistakes. When you build with Lovable, your project code is stored and managed inside the Lovable platform. GitLab is a platform for storing, managing, and sharing code, with version control, merge requests and code reviews, and CI/CD pipelines.

If you want your own copy, plan to collaborate with developers, or move your project elsewhere, you can export and sync your project to GitLab: back up your code, review changes in merge requests, work locally in your IDE, test features on branches, and deploy outside Lovable. With GitLab Self-Managed, you can also keep a copy of your code within your own infrastructure. This page covers Git sync for your Lovable project’s codebase.

To build an app that reads or updates GitLab projects, issues, merge requests, pipelines, or repository files through the REST API, use GitLab API . For the full picture of what Git sync is, how the two-way sync model works across providers, and how to choose between GitHub, GitLab, and Bitbucket, see the Git sync overview . You don’t need GitLab to use Lovable. Many users build and launch entirely within Lovable. If you only need a copy of your code, you can download your code directly from Lovable: use the Download codebase section in Project settings → Git , or open the Code editor and click Download codebase at the bottom of the file tree sidebar (paid plans).

How GitLab Git sync works Like all Git sync , the GitLab integration has two layers: A workspace connection A project repository link Workspace connection A workspace connection authorizes Lovable to access a GitLab namespace (your personal account or a group) through OAuth. Lovable requests the api scope, which it needs to create projects, configure webhooks, manage branches, and open merge requests. Every project in the workspace can use the same workspace connection.

A workspace can contain: Multiple GitLab connections Multiple group namespaces from the same GitLab account or instance One personal-account namespace (a workspace can have only one personal GitLab account connection, alongside any number of groups) Both GitLab connection types (GitLab.com and Self-Managed) Project repository link A project repository link connects one Lovable project to one GitLab repository. When connected: Changes made in Lovable sync to GitLab Changes pushed to the active GitLab branch sync back into Lovable Lovable only edits and syncs one branch at a time GitLab Git sync connection types Lovable supports two GitLab connection types: GitLab.com The hosted service managed by GitLab Inc.

You authorize Lovable with your GitLab.com account. GitLab Self-Managed A GitLab instance that your organization runs on its own servers. You create an OAuth application in your instance, so credentials remain under your control, and allowlist Lovable’s IP ranges. When you add a new connection, you choose which type to set up. Both types support the same two-way sync, branch operations, and merge request creation between Lovable and your GitLab repository.

Role-based access for GitLab integration Role Allowed action Workspace owner or admin only Add a workspace connection Update a workspace connection Reconnect a workspace connection (re-authorize GitLab) Delete a workspace connection Enable or disable Include member email addresses in commits (Business and Enterprise plans) Workspace owner or admin Project owner or admin Connect a project to a repository Disconnect a project from a repository Workspace editor or higher Project editor or higher View sync status Switch branches Create branches View the connection in Workspace settings → Git → GitLab Create a workspace GitLab connection Workspace admins and owners can create workspace connections from: Workspace settings → Git → GitLab → Add connection Project settings → Git → GitLab → Add connection (if a project has not been connected yet) To set up a new connection, follow the steps for your connection type: GitLab.com (hosted) GitLab Self-Managed GitLab.com is the hosted service managed by GitLab Inc.

You need a GitLab account. You can create one for free at gitlab.com . 1 Add a new connection Click Add connection and select GitLab.com . 2 Authorize your GitLab account Click Authorize with GitLab . A popup opens to GitLab’s authorization page. Sign in and authorize Lovable to access your GitLab account. Lovable requests the api scope, which is required to create projects, configure webhooks, manage branches, and open merge requests.

3 Select a namespace Choose where your project repositories should live: Select your personal account or one of your GitLab groups . Click Connect next to the namespace you want to use. You can connect multiple group namespaces from the same GitLab account, plus your personal account. You cannot connect the same personal account or group more than once, and a workspace can have only one personal-account connection. GitLab Self-Managed is intended for organizations that run their own GitLab server and need their code to stay within internal infrastructure.

This setup requires: Admin access to your GitLab instance to create an OAuth application Network access from Lovable’s public IP ranges 1 Add a new connection Click Add connection and select GitLab Self-Managed . 2 Allow Lovable's IP ranges Lovable needs to reach your GitLab instance to sync code and receive webhook events. The setup wizard displays the IP ranges you need to allowlist if your instance is protected by a firewall.

Copy each one and add it to your network firewall or GitLab’s IP allowlist settings. 3 Create an OAuth application in your GitLab instance In your GitLab instance, go to Admin Area → Applications (or Settings → Applications for a user-level app) and create a new application: Name: Lovable (or any descriptive name) Redirect URI: Use the URI shown in the Lovable setup wizard (for example, https://lovable.dev/gitlab/callback ) Scopes: api Confidential: Yes Save the application and note the Application ID and Secret .

Keep your Application Secret confidential. It grants access to your GitLab instance on behalf of your users. 4 Configure the connection in Lovable Back in the Lovable setup wizard, fill in: GitLab URL: Your instance URL (e.g., https://gitlab.yourcompany.com ) Application ID: The client ID from the OAuth app you created Application secret: The client secret from the OAuth app Group path (optional): If you want to restrict access to a specific group, enter the group path (for example, my-org/my-team ) Click Continue .

5 Authorize your GitLab account Click Authorize with GitLab . A popup opens to your self-managed GitLab instance’s authorization page. Sign in and authorize Lovable. Lovable requests the api scope. 6 Select a namespace Choose between your personal account or one of your GitLab groups within the instance, then click Connect . Link a project to a GitLab repository When there is an active workspace GitLab connection, workspace or project admins and owners can connect a Lovable project to a GitLab repository.

When you connect a project, Lovable creates a new GitLab repository. The repository is private by default , so nobody can see your code unless you change its visibility on GitLab. Each Lovable project can connect to one repository on one provider. If the project already syncs with GitHub or Bitbucket, the GitLab card does not appear in Project settings → Git until you disconnect the project from that provider. 1 Open the project's GitLab settings Open Project settings → Git → GitLab .

2 Connect the project Under Connect project , click Connect next to the namespace (personal account or group) where the new repository should be created. Lovable creates a new GitLab repository and starts two-way sync automatical

The rest of this page is on the live site.