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 theapi scope, which it needs to create projects, configure webhooks, manage branches, and open merge requests.
Workspace connections are shared across the workspace and can be reused by multiple projects.
A workspace can contain:
- Multiple GitLab connections
- Multiple group namespaces from the same GitLab account or instance
- One personal-account namespace (a workspace can hold only one personal GitLab account, 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.
Role-based access for GitLab integration
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)
- GitLab.com (hosted)
- GitLab Self-Managed
Add a new connection
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.
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.- Connecting a project 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.
Open the project's GitLab settings
Connect the project
Manage a project’s repository sync
After connecting a project to a GitLab repository, you see the following in the project’s GitLab settings:- Repository status as Connected
- Branch picker with active branch name (GitLab branch synced with Lovable)
- Clone URLs (HTTPS, SSH)
- Option to View on GitLab (available from the dropdown)
- Option to Disconnect (available from the dropdown)
main). Changes pushed to the currently active branch sync back into Lovable.
Switch branches
- Click the branch picker.
- Search or select a branch.
- Click the branch to switch.
Create a new branch
- Click the branch picker.
- Click + Create branch at the bottom of the list.
- Enter a branch name. Lovable validates it against empty names, invalid characters, and duplicates.
Branch names must follow Git naming rules (no spaces, .., leading or trailing dots or dashes, and special characters like ~ ^ : ? * [ ] \).
Source: <active branch> in the dialog). Lovable automatically switches to the new branch and starts editing and syncing it.
Clone the repository locally
After connecting a project, Lovable provides clone URLs for:- HTTPS
- SSH
Commit attribution
Commits made by Lovable are pushed through the GitLab account that authorized the workspace connection, so GitLab attributes pushes to that user. There is no separate bot identity (unlike the Lovable GitHub app).Disconnect a project from GitLab
Disconnecting removes the sync relationship between a Lovable project and a GitLab repository. 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 project and its code stay in Lovable. Future changes are stored only inside Lovable.
- Lovable creates a new repository with the current version of your project.
- The original repository stays unchanged on GitLab and is no longer linked to Lovable.
Unlink projects from a workspace GitLab connection
Workspace admins and owners can remove specific projects from a connection without deleting the connection entirely. The connection remains available for other projects.Open GitLab settings
Open the connection
Select projects
Confirm
- Click Unlink N projects (where
Nis the number of projects you selected) - Click Unlink to confirm
Delete a workspace GitLab connection
Workspace admins and owners can delete GitLab connections. Deleting a workspace GitLab connection:- Removes the connection for all projects
- Stops syncing for linked projects
- Does not delete repositories on GitLab
- Deletes stored credentials
Open GitLab settings
Open the connection you want to remove
Review linked projects
Delete
Limitations
The GitLab Git sync integration currently does not support:- Importing existing GitLab repositories into Lovable. You can only export from Lovable to GitLab.
- Reconnecting to the same repository after disconnecting. A new repository is created on reconnect.
- Connecting the same personal account or group more than once, or more than one personal GitLab account per workspace.
- Automatically following repository renames or moves. Unlike GitHub, renaming or moving a GitLab project breaks the sync.
Troubleshooting
My commits and pushes from GitLab aren't showing up in Lovable.
My commits and pushes from GitLab aren't showing up in Lovable.
main).If you pushed commits to a different branch in GitLab, you have two options:- Merge your changes into the synced branch. For example, open a merge request from your feature branch into
mainand merge it. Lovable then picks up those commits. - Switch the synced branch in Lovable. In your project’s GitLab settings, select the branch where your commits live. Lovable starts editing and syncing that branch instead, and your commits will appear.
I see a "lovable-fallback" branch in the branch picker.
I see a "lovable-fallback" branch in the branch picker.
lovable-fallback so you can keep editing without errors. Your repository is otherwise untouched.Pick another branch or recreate the original branch. You can leave or delete lovable-fallback in GitLab once you’ve moved on.My push from Lovable ended up on a "lovable-sync-<timestamp>" branch instead of the synced branch.
My push from Lovable ended up on a "lovable-sync-<timestamp>" branch instead of the synced branch.
lovable-sync-<timestamp> branch instead.Open that branch on GitLab, review the changes, and merge them into your protected branch through your usual review process.GitLab Self-Managed: Auth token is expired, but I am unable to reconnect the GitLab connections.
GitLab Self-Managed: Auth token is expired, but I am unable to reconnect the GitLab connections.
- In GitLab, go to Settings → Applications or Admin Area → Applications, find the Lovable application, and revoke its access.
- In Lovable, trigger a sync by making a change in a project linked to your GitLab instance (or wait for the next one). The connection will move into a “needs reconnect” state.
- In Lovable, as a workspace admin, in the GitLab connection, select Reconnect and sign into GitLab again.
FAQ
Can I push large files to my GitLab repository?
Can I push large files to my GitLab repository?
Is the GitLab project Lovable creates public or private?
Is the GitLab project Lovable creates public or private?
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?
- Disconnect the project from the current GitLab connection (there’s a disconnect option in the project’s GitLab settings)
- Delete the existing connection if you want a different personal account (a 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 changes into the synced branch, or switch the synced branch in your project’s GitLab settings.Can I edit a non-default branch from inside Lovable?
Can I edit a non-default branch from inside Lovable?
main) first.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?