Sync your Lovable project with GitLab
You can connect your Lovable project to GitLab to automatically back up your code and sync changes both ways. Edits in Lovable push to your GitLab repository, and commits pushed to GitLab sync back into Lovable.
Anyone who wants an external backup of their project, needs to collaborate with software engineers, or wants to work on code locally in their own editor.
Do this, in order
- 1
Open Project settings, navigate to the Git tab, and select GitLab.
This is where you configure code syncing for your project.
- 2
Click Add connection, select GitLab.com (or GitLab Self-Managed), and authorize Lovable to access your account.
Lovable needs permission to create private repositories, open merge requests, and manage branches.
- 3
Choose your personal account or a group namespace, then click Connect.
Lovable creates a new private repository under that namespace and starts two-way syncing right away.
- 4
Use the branch selector in settings whenever you need to switch which branch Lovable edits or create a new branch.
Lovable edits and syncs only one branch at a time.
Paste this into your project
Migrate large files to CDN assets so that all repository files stay under 10 MB.
Words decoded
- Two-way sync
- An automatic process where changes in Lovable push to GitLab, and new code pushed to GitLab imports back into Lovable.
- Repository
- A project folder hosted on GitLab that stores all your code and keeps a history of every change made over time.
- Branch
- A parallel version of your project's code where you can build or test features without affecting other versions.
- Namespace
- The personal username or team group in GitLab where projects and repositories live.
Where people get stuck
- Do not rename, move, or delete your GitLab repository, username, or group path after connecting, as this immediately breaks sync.
- You cannot import an existing GitLab repository into Lovable; connecting will always create a new repository from your current Lovable project.
- Lovable cannot save any file larger than 10 MB, so pushing large media files to your synced repository will cause Lovable edits to fail.
- Disconnecting and reconnecting later will create a fresh repository rather than linking back to your previous one.
- When creating a new branch inside Lovable, it copies from your currently active branch, not automatically from main.
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.