- GitHub (github.com, GitHub Enterprise Cloud with data residency, or GitHub Enterprise Server)
- GitLab (GitLab.com or a self-managed GitLab instance)
Why sync your project to a Git repository
- Back up your code. Store your project safely outside Lovable, in an account you control.
- Collaborate with developers. Use branches, pull or merge requests, and code reviews alongside building in Lovable.
- Work locally in your IDE. Clone the repository, edit and commit locally, and push. Your changes sync back into Lovable.
- Deploy outside Lovable. Self-host or deploy to other platforms. See Deployment, hosting, and ownership options.
- Keep a copy of your code within your own infrastructure. Sync to GitHub Enterprise Cloud with data residency, GitHub Enterprise Server (both Enterprise plan), or a self-managed GitLab instance.
How Git sync works
Git sync has two layers, for both GitHub and GitLab:- A workspace connection authorizes Lovable to access a Git account, organization, group, or instance. Connections belong to the workspace and can be reused by any project in it. A workspace can hold multiple connections, including connections to both GitHub and GitLab at the same time.
- A project repository link connects one Lovable project to one repository under one of those connections. Linking a project creates a new repository and starts two-way sync automatically.
- Edits made in Lovable are committed and pushed to your repository.
- Commits pushed to the synced branch flow back into your Lovable project.
- Lovable edits and syncs one branch at a time. Commits on other branches don’t appear in Lovable until you merge them into the synced branch or switch the synced branch. You can switch branches and create new branches from Lovable on both providers.
Who can do what
- Workspace owners and admins add, update, and delete workspace connections, and enable or disable commit attribution.
- Workspace or project owners and admins connect and disconnect projects.
- Editors and above view sync status and work with the synced repository.
Choose a provider
Each project links to one repository on one provider. Both providers support the same core two-way sync.Commit attribution
Commits that Lovable pushes are not authored by the workspace member who triggered them. On GitHub they come from the Lovable GitHub app, and on GitLab they are pushed through the account that authorized the workspace connection. For how each platform still credits the member behind a change, see commit attribution for GitHub and GitLab. To record who triggered each change, a workspace owner or admin can enable Include member email addresses in commits in Workspace settings → Git → Commit attribution. The setting is available on the Business and Enterprise plans and is disabled by default. On other plans the section does not appear. While it is enabled, commits Lovable makes on a member’s behalf carry that member’s email address on its own line in the commit message body:- Members with no connected GitHub account. Lovable cannot co-attribute their commits at all, so without this setting nothing in the repository records who triggered the change.
- GitLab repositories. The co-author line names a GitHub account, so it does not identify your GitLab users.
Disconnecting and reconnecting
Disconnecting a project stops the sync, nothing more:- Your repository stays on GitHub or GitLab, intact with all history and files.
- Your project and its code stay in Lovable. Future changes are stored only in Lovable.
Limitations
These apply to both providers:- Export only. You can’t import an existing repository into Lovable. Connecting a project always creates a new repository.
- One repository per project. Each Lovable project links to exactly one repository.
- One branch at a time. Only the synced branch flows back into Lovable.
- Keep the repository where it is. Don’t rename, move, or delete a connected repository (or the account, organization, or group it lives in). Doing so breaks the sync.
- Reconnecting creates a new repository. You can’t re-link a previously disconnected repository.
- No sync for drafts. A draft doesn’t appear as a branch in your repository. Its code reaches the repository after you accept the draft, like any other project change.
FAQ
Do I need to know Git to use this?
Do I need to know Git to use this?
Do I need Git sync just to get a copy of my code?
Do I need Git sync just to get a copy of my code?
Can I use both GitHub and GitLab?
Can I use both GitHub and GitLab?
Does pushing to my repository update my live site?
Does pushing to my repository update my live site?
Is my database included in the repository?
Is my database included in the repository?
Can I import an existing repository into Lovable?
Can I import an existing repository into Lovable?
Do I need commit attribution if my team already connected their GitHub accounts?
Do I need commit attribution if my team already connected their GitHub accounts?
Can I remove member email addresses from commits I already pushed?
Can I remove member email addresses from commits I already pushed?
Is my code still in Lovable after I connect?
Is my code still in Lovable after I connect?