Export a Lovable project to GitHub

Lovable can push your project to a GitHub repository and keep it in sync. It works on every plan, also the free one (checked on 15 October 2026). This is the first step of every Lovable migration.

Get your Lovable code into a repo you own

1. Open the GitHub connection in Lovable

Open the project in Lovable. Open the project settings, then Git, then GitHub.

GitLab and Bitbucket work too. On paid plans you can also export the code as a ZIP file (Download codebase, at the bottom of the file panel), but a ZIP does not stay in sync.

The Lovable project settings, Git page, with the repository connected and in sync with GitHub

2. Authorize the Lovable GitHub app

The first time, Lovable asks you to add your GitHub account (Add connection, in the workspace settings under Git, GitHub). GitHub asks you to install the Lovable app on your account or an organization. Choose where the repository should live. You can give it all repositories or only the ones you select.

The GitHub page that installs the Lovable app, with the account to install it on marked

3. Create the repository

Back in Lovable, click Connect. Lovable creates a new private repository, pushes the full project to its default branch and starts the two-way sync.

You cannot pick a repository you already have. Lovable always creates a new one. It stays private until you change that in the repository settings on GitHub.

4. Check what arrived

Open the repository on GitHub. You should see package.json and a src folder. Projects with a backend (Lovable Cloud or Supabase) also have a supabase folder with the migrations and edge functions.

Secrets you stored in Lovable are not in the repository. The .env file only holds public values, like the address and the public key of the backend.

Your data is not in the repository either: what is saved in the database, uploaded files and user accounts. Connectors and the key for Lovable AI also stay in Lovable. If your app has a backend, the database guide under Read next shows how to move it.

The new GitHub repository with the src and supabase folders and package.json in the file list

5. How the Lovable GitHub sync works

Changes you make in Lovable are pushed to GitHub. Commits you push to the default branch are pulled into Lovable. Work on one side at a time to avoid conflicts.

Lovable works on one branch: the default branch, unless you pick another one in the GitHub settings. If you disconnect, the repository stays on GitHub. If you connect again later, Lovable creates a new repository.

If both sides change the same thing, Lovable puts its changes on a separate branch called lovable-sync. Merge it on GitHub to bring them back.

Never force-push to the branch Lovable works on. It can replace work done in Lovable. Lovable saves a backup first, and the project owner can restore it in the Git settings.

You can rename the repository and the sync keeps working. If you delete it, the sync stops.

Want to edit in Cursor, Claude Code or Codex while Lovable stays connected? Follow Keep Lovable in sync when you edit in another tool.

Sources

  1. Lovable docs: GitHub integration
  2. Lovable docs: Git sync
  3. Lovable docs: Code mode
  4. Lovable docs: Deploy and host outside Lovable

Read next

Pick your route.

Choose where you are and where you want to go. The guide takes it from there.