Text of docs.lovable.dev › integrations › git-sync-overview as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Sync your Lovable project code with GitHub, GitLab, or Bitbucket - Lovable Documentation

Documentation Index Fetch the complete documentation index at: /llms.txt Use this file to discover all available pages before exploring further. Skip to main content Assistant Responses are generated using AI and may contain mistakes. When you build with Lovable, your project code is stored and managed inside the Lovable platform. Git sync connects a Lovable project to a repository you own on GitHub, GitLab, or Bitbucket, and keeps the two in sync automatically: changes you make in Lovable are committed to your repository, and commits pushed to the synced branch appear back in your Lovable project.

You don’t need Git to use Lovable. Many users build and launch entirely within Lovable. If you only need a copy of your code, use the Download codebase section in Project settings → Git , or open the Code editor and click Download codebase at the bottom of the file tree sidebar (paid plans). This page explains how Git sync works across providers. In a project, you manage the connection in Project settings → Git .

For setup steps, see the provider pages: GitHub (github.com, GitHub Enterprise Cloud with data residency, or GitHub Enterprise Server) GitLab (GitLab.com or a self-managed GitLab instance) Bitbucket (Bitbucket Cloud) Want your app to call the GitHub REST API to read repositories, issues, and pull requests instead? Use the GitHub API connector . 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. See Work locally in your IDE . 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, on every provider: A workspace connection authorizes Lovable to access a Git account, organization, group, workspace, or instance. Connections belong to the workspace, and any project in the workspace can use them. A workspace can have multiple connections, including connections to GitHub, GitLab, and Bitbucket at the same time.

A project repository link connects one Lovable project to one repository under one of those connections. When you first link a project, Lovable creates a new repository and starts two-way sync automatically. After you link a project: Lovable commits the edits you make in Lovable and pushes them to your repository. Commits you push to the synced branch appear in your Lovable project. Synced commits go through the same checks as edits made in Lovable.

If they change your dependencies, Lovable runs the dependency audit and updates the project’s Security view . 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 every provider. Sync status The sync status card in Project settings → Git compares the synced branch in Lovable with the same branch on your provider.

Each label names your provider. On a GitHub project, the card shows one of the following states: In sync with GitHub : Lovable and GitHub are on the same commit. Lovable is N commits ahead of GitHub : Lovable pushes these changes to GitHub on the next sync. GitHub is N commits ahead of Lovable : Lovable hasn’t pulled these commits yet. If this state persists after you push, follow the troubleshooting entry for GitHub , GitLab , or Bitbucket .

Lovable and GitHub have diverged : Lovable and GitHub each have commits that the other does not. Lovable pushes its changes to a separate lovable-sync branch instead of the synced branch, and the next sync from GitHub replaces Lovable’s version of the branch with the GitHub version. Couldn’t check GitHub right now or Sync state couldn’t be determined : the comparison failed, or the two histories don’t meet within the commits Lovable compares.

Click Re-check to compare again. Lovable compares the 50 most recent commits on each side, so a count can read 50+ . The card also shows when Lovable last synced the branch and when it last checked the status. Click Re-check to compare the branches again. Re-check doesn’t sync anything. Roles and permissions 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. Project owners restore Lovable work after a repository push replaces it. The provider pages list the exact role requirements for each action. Choose a provider Each project links to one repository on one provider. All providers support the same core two-way sync. GitHub GitLab Bitbucket Hosted service github.com (all plans) GitLab.com (all plans) Bitbucket Cloud (all plans) Your own infrastructure GitHub Enterprise Cloud with data residency, or GitHub Enterprise Server (both Enterprise plan) Self-managed GitLab instance (all plans) Not available (Bitbucket Data Center is not supported) Connection method Lovable GitHub App (or your own copy of it on Enterprise Server) OAuth with your GitLab account OAuth with your Atlassian account Synced branch Active branch: switch and create branches from Lovable Active branch: switch and create branches from Lovable Active branch: switch and create branches from Lovable Repository renames Followed automatically Break the sync Followed automatically If your team already uses one of these platforms, use that one.

Work locally in your IDE When a project syncs with a repository, you can clone that repository, edit the code with your own IDE or coding assistant, and push the result back. Commits on the synced branch appear in your Lovable project, and you continue building on them in Lovable. Repository access and project access are separate. To push, you need write access to the repository on your Git provider. To keep building in Lovable, you need an editor role on the project.

Check the README and package.json in the repository for what you need installed and for the commands that install dependencies and start the app. Keep Lovable and your work on separate branches Lovable edits and syncs one branch at a time. The branch picker in Project settings → Git shows which one. Keep Lovable on that branch, usually main , and make your local changes on a feature branch. The feature branch stays out of your Lovable project until you merge it into the synced branch, so unreviewed work does not reach the project.

When you merge, Lovable pulls the result. Do not force-push, rebase, or squash commits that are already on the synced branch. Lovable keeps its own copy of that branch. When you rewrite its history, the next sync saves a backup of Lovable’s copy and then replaces it with yours. The project owner can restore the backup . To undo a change, add a commit that reverts it. If your team requires a pull or merge request for every change to main , switch Lovable to a feature branch of its own and merge its work through the same review process.

Your Git provider rejects Lovable’s pushes to a protected branch, and Lovable then pushes to the lovable-sync branch instead. See the troubleshooting entry for GitHub , GitLab , or Bitbucket . Restore Lovable work after a push replaces it When a push to the synced branch replaces commits that Lovable made, Lovable saves a backup of its copy of the branch first. A notice appears in the editor and in Project settings → Git : A repository push replaced your Lovable work .

Click Review r

The rest of this page is on the live site.