KBAISE/ for lovable
Library
Docs

Sync your Lovable project with GitLab

about 10 minBuildingchecked 2h agoOfficial page
The short version

You can connect your Lovable project to GitLab to automatically save your code there, making it easy to back up, work with others, or use other GitLab tools. This connection lets changes you make in Lovable sync to GitLab, and changes in GitLab sync back to Lovable.

Anyone who wants to back up their Lovable project code, collaborate with developers, or use GitLab's advanced features needs this.

Do this, in order

  1. 1

    Go to your Lovable workspace settings, then find the 'Git' section and choose 'GitLab'.

    This is where you start the process of linking Lovable to your GitLab account or organization.

  2. 2

    Click 'Add connection' and select either 'GitLab.com' if you use the hosted service, or 'GitLab Self-Managed' if your organization runs its own GitLab server.

    You need to tell Lovable which type of GitLab you are using to ensure the correct setup process.

  3. 3

    Follow the on-screen instructions to authorize Lovable to access your GitLab account and choose which personal account or group your projects should live under.

    This step grants Lovable the necessary permission to create and manage repositories on your behalf in GitLab.

  4. 4

    Once the workspace connection is active, go to your specific Lovable project's settings, then 'Git', and choose 'GitLab'.

    This takes you to the project-specific settings where you can link it to a GitLab repository.

  5. 5

    Under 'Connect project', click 'Connect' next to the GitLab account or group you just linked.

    This action creates a new, private GitLab repository for your Lovable project and starts the automatic two-way syncing.

Paste this into your project

I want to sync my Lovable project with GitLab. Please connect my project to a new private GitLab repository. I'm using GitLab.com. Here's my GitLab account information: [Lovable will prompt you for this during the connection process].

Words decoded

GitLab.com
This is the version of GitLab that is hosted and managed by the company GitLab itself, accessible online.
GitLab Self-Managed
This is a version of GitLab that an organization installs and runs on its own computer servers, keeping all code and data within their own infrastructure.
OAuth
A secure way for you to give Lovable permission to access parts of your GitLab account without sharing your password directly.
Namespace
In GitLab, this refers to your personal account or a group where your projects (repositories) are organized and stored.
Repository
A digital storage space in GitLab where all the files, folders, and history of a single project are kept.
API scope
A specific permission that Lovable requests from GitLab, allowing it to perform actions like creating projects, managing branches, and setting up automatic updates on your behalf.
Webhooks
Automatic messages sent from GitLab to Lovable whenever certain events happen (like a code change), helping Lovable stay updated.
Branch
A separate line of development in your project's code. It allows you to work on new features or fixes without affecting the main version of your project until you're ready to combine them.
CI/CD pipelines
Automated processes in GitLab that help developers quickly and reliably build, test, and deploy their software changes.

Where people get stuck

  • Do not rename, move, or delete your GitLab project or change your GitLab username/group after connecting, as this will break the sync.
  • Lovable only syncs one branch at a time; if your changes aren't appearing, ensure they are merged into the currently synced branch or switch the active branch in Lovable.
  • If 'Connect GitLab' does nothing, your browser might be blocking pop-ups; allow pop-ups for Lovable.
  • You cannot import existing GitLab repositories into Lovable; you can only export from Lovable to GitLab.
  • You cannot reconnect to the *same* repository after disconnecting; Lovable will create a new one if you reconnect.
  • A workspace can only connect to one personal GitLab account, though it can connect to multiple GitLab groups.

The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.