- Back up your code: Store your project safely outside Lovable.
- Collaborate easily: Invite developers, use merge requests, branches, and code reviews.
- Sync automatically: Edits in Lovable appear in GitLab, and changes in GitLab sync back on the default branch (typically
main). - Work locally: Clone, edit, and commit in your IDE while keeping your project synced.
- Deploy anywhere: Self-host or deploy to alternative platforms. See Deployment, hosting, and ownership options with Lovable Cloud.
- Use your company’s infrastructure: With GitLab Self-Managed, keep your code entirely within your organization’s own servers.
How GitLab connections work
Lovable supports two GitLab connection types through a single unified connector:- GitLab.com is the hosted service managed by GitLab Inc.
- GitLab Self-Managed lets you connect to a GitLab instance that your organization runs on its own servers.
- You can create multiple GitLab connections.
- Each connection is linked to a namespace (personal account or group) on a GitLab instance.
- You can connect multiple namespaces from the same GitLab account or instance.
- Each Lovable project can be linked to one repository within one of those namespaces.
How to connect GitLab
Workspace admins and owners can manage the GitLab connector, which includes adding connections and linking or unlinking projects. Users with editor role can link or unlink projects.Prerequisites
- A GitLab account on gitlab.com or on your self-managed instance.
- Lovable workspace admin or owner role.
- For GitLab Self-Managed: admin access to your GitLab instance to create an OAuth application, and network access from Lovable’s IP ranges.
Before you connect
- Single source of truth: When connected, your code lives in GitLab, not separately in Lovable.
- Two-way sync: Edits in Lovable appear in GitLab, and vice versa.
- Stable repo path: The connection depends on the exact GitLab project name, namespace, and instance URL.
Step 1: Set up a GitLab connection
- GitLab.com (hosted)
- GitLab Self-Managed
Authorize your GitLab account
api scope, which is required to create projects, configure webhooks, manage branches, and open merge requests.Select a namespace
- Select your personal account or one of your GitLab groups.
- Click Connect next to the namespace you want to use.
Step 2: Connect a project to GitLab
Once you have an active GitLab connection, editors and above can link a Lovable project to a GitLab repository. Each Lovable project can have one linked repository.Open project settings
Choose a namespace
Disconnect a project from GitLab
Workspace admins and owners can disconnect (unlink) any project from GitLab at any time in the project’s GitLab settings. When you disconnect:- Sync stops: The two-way connection between Lovable and GitLab ends.
- Your repository stays on GitLab: It remains intact with all history and files.
- Your code stays in Lovable: Future changes are stored only inside Lovable.
- A new GitLab repository is created using your latest Lovable code.
- Your original repository stays on GitLab but is no longer linked to Lovable.
Limitations
The GitLab connector currently does not support:- Importing an existing GitLab repository into Lovable. You can only export from Lovable to GitLab.
- Syncing branches other than the default branch (usually
main). - Reconnecting to the same repository after disconnecting. A new repository is created on reconnect.
How to unlink projects from a connection
Editors and above can remove specific projects from a connection without deleting the connection entirely. The connection will remain available for other projects. To unlink projects:How to delete a connection
Workspace admins and owners can delete connections. Before deleting, review the Linked projects section to see which projects are currently using the connection. To delete a connection:FAQ
Do I need to know GitLab to use this feature?
Do I need to know GitLab to use this feature?
Clicking 'Connect GitLab' does nothing. What's wrong?
Clicking 'Connect GitLab' does nothing. What's wrong?
What happens if I rename, move, or delete my GitLab project?
What happens if I rename, move, or delete my GitLab project?
What happens if I rename my GitLab username or group?
What happens if I rename my GitLab username or group?
How can I switch to a different GitLab account?
How can I switch to a different GitLab account?
- Unsync the project from the current GitLab connection (there’s a disconnect option in settings)
- Delete the existing connection if you want a different personal account (workspace allows only one personal GitLab account)
- Create a new connection with the correct GitLab account
- Reconnect the project to the new connection
Can I disconnect from GitLab?
Can I disconnect from GitLab?
Can I import an existing GitLab repo into Lovable?
Can I import an existing GitLab repo into Lovable?
Why don't my commits appear in Lovable?
Why don't my commits appear in Lovable?
main). Merge your branch into main to see it inside Lovable.Can I connect multiple GitLab groups?
Can I connect multiple GitLab groups?
What's the difference between GitLab.com and GitLab Self-Managed?
What's the difference between GitLab.com and GitLab Self-Managed?
What OAuth scopes does Lovable request?
What OAuth scopes does Lovable request?
api scope, which is the minimum required to create projects, configure webhooks, manage branches, and open merge requests on your behalf.My self-managed GitLab instance is behind a VPN. Will it work?
My self-managed GitLab instance is behind a VPN. Will it work?