Hire Lovable Xperts
GitHub & Repo

Can You Import an Existing GitHub Repo Into Lovable?

Yes, as a one-time import, not as a live connection. Lovable's Git sync always creates a new repository, so you can't attach an existing repo to a project. Instead, download the repo as a ZIP and upload it with Import project: Lovable rebuilds the app, then you connect Git sync to the new project. Commit history, database rows and user accounts don't come across.

By Hire Lovable Xperts · Last verified: 2026-11-16

Can I import an existing GitHub repo into Lovable?

Yes, but only as a one-time import. Lovable's docs say Git sync can't link to an existing repository: connecting a project always creates a new one. To bring existing code in, download the repository as a ZIP on GitHub (Code → Download ZIP) and upload it with Import project. Lovable rebuilds the app from that ZIP, and you then connect Git sync so the new project gets its own repository.

The import never connects to GitHub itself. Lovable's import page says it works from the ZIP you upload and does not connect to the other tool, so your original repository is left exactly as it is, with its full history, while the rebuilt project syncs to a new repository.

Lovable is rolling out project import gradually. If "Import project to Lovable" is not in the dashboard + menu, Lovable's docs say your account does not have it yet.
What you can and can't do with an existing repository (Lovable docs)
What you want to doPossible?What actually happens
Connect Git sync to an existing repoNoConnecting a project always creates a new repository (GitHub, GitLab or Bitbucket), private by default on GitHub
Bring an existing repo's code into LovableYes, as a ZIP importDownload the ZIP, then Import project → Upload code; Lovable rebuilds the app and the import uses credits
Keep the old repo's commit history in the projectNoThe rebuilt project syncs to a new repository; the old repository keeps its history untouched
Pull commits from GitHub back into LovableYesSync is two-way on one branch: commits pushed to the synced branch appear in Lovable
Edit the project in VS Code or CursorYesClone the synced repository and push to the synced branch; other branches sync only after you merge them
Bring database rows, users and uploaded filesNoA code ZIP carries none of them, and passwords and active sessions do not transfer

How do I import a GitHub repo into Lovable, step by step?

The import works from a ZIP, not from a GitHub link. Lovable's docs give this order: download the repository as a ZIP, upload it with Import project, then connect Git sync so the rebuilt project gets its own repository. Clean the ZIP before you upload it: the import has size limits, and secrets in a .env file should never travel with the code.

  1. On GitHub, open the repository and click Code → Download ZIP.
  2. Remove .env files, node_modules and build output from the ZIP, as Lovable's docs advise. The ZIP can be at most 250 MB.
  3. In Lovable, open the + menu on the dashboard, choose Import project to Lovable, then Upload code under "Code & web".
  4. Let Lovable rebuild the app. The import counts as standard build usage, and the credits it uses depend on the project's size and how much Lovable has to rewrite.
  5. Add your secrets and API keys to the new project yourself; they should not have been in the ZIP.
  6. If the app had a database, load the data table by table: Lovable does not accept a single SQL dump of the whole database.
  7. Connect Git sync: Project settings → Git → GitHub → Connect. Lovable creates a new private repository and starts two-way sync.
Test sign-in, payments and every form in the rebuilt app before anyone relies on it. Passwords and active sessions don't transfer, so existing users of the old app will need to sign in again or reset their passwords.

What changes when Lovable rebuilds an imported repo?

An import is a rebuild, not a copy. Lovable's docs say it rebuilds the app the way it builds new Lovable apps, on TanStack Start, so the code that comes back can be structured differently from the code you uploaded. The docs also tie the credit cost to how much Lovable has to rewrite, which tells you to expect real changes, not a file-for-file transfer.

That is also why your commit history does not carry over: the project's history starts with the rebuilt code in its new repository. Keep the original repository as your reference while you compare the two apps screen by screen.

If the original app was built in another tool, Lovable's import dialog lists guided export steps for Replit, Manus, Bolt, Base44 and v0, and Upload code covers any other ZIP.

Does Lovable's GitHub sync work both ways?

Yes. Lovable's docs describe Git sync as two-way: edits made in Lovable are committed to your repository, and commits pushed to the synced branch appear in Lovable. It syncs one branch at a time, usually the default branch, so work on other branches appears only after you merge it. If a push never shows up in Lovable, pushing any new commit to the synced branch triggers the sync.

When GitHub rejects Lovable's push, most often because of a branch protection rule, Lovable pushes its changes to a branch named lovable-sync instead of losing them; review that branch and merge it. Lovable's docs also warn against force-pushing, rebasing or squashing commits that are already on the synced branch.

One gap to know about: when synced commits change a Supabase Edge Function, Lovable does not deploy the changed function, so backend changes need their own deploy step.

Related: fix a Lovable GitHub sync that stopped working

When is importing into Lovable the wrong move?

When the repository is a working app with real users. An import replaces code that has been tested in production with regenerated code, and it leaves your data, users and sessions behind. If what you need is to fix, secure or ship an existing codebase, keep the code you have, work in your own editor, and bring in an engineer for the parts that are stuck.

Import fits best for prototypes and small apps you want to keep iterating on with prompts, or for moving a project into Lovable from another builder.

Related: fix a broken Lovable app without rebuilding it

What is the path for teams who outgrow Lovable?

The usual exit runs the other way: clone the Lovable-synced repository, set up a local development environment, point it at the Supabase project the app already uses, and keep building with standard tools. You keep your data and your code. What you give up is the Lovable editor and prompting, unless you keep pushing to the synced branch so both stay in step.

The friction is rarely in the front-end code. It is in the Supabase configuration: Row Level Security policies, edge functions, storage bucket settings and auth configuration all need to be documented and moved in the right order.

Auth is the sharpest edge of that. No code export carries your users with it, so migrating auth users and password hashes to your own Supabase is a separate pg_dump and psql pass over the auth schema — the one the Supabase CLI skips by default. Skip it and every existing account has to reset its password on cutover day.

Frequently asked questions

Can I import an existing GitHub repo into Lovable?
Yes, as a one-time import. Download the repository as a ZIP (Code → Download ZIP on GitHub) and upload it with Import project → Upload code. Lovable rebuilds the app from the ZIP; it does not connect to your existing repository, which stays on GitHub unchanged.
Can I connect Lovable to an existing GitHub repository?
No. Lovable's docs say connecting a project always creates a new repository, private by default on GitHub. To start from existing code, import the repository as a ZIP first, then connect Git sync to the new project.
Does Lovable sync changes from GitHub back into the editor?
Yes. Git sync is two-way: commits pushed to the synced branch appear in Lovable, and Lovable's edits are committed to the repository. Only one branch syncs at a time, so commits on other branches appear after you merge them into the synced branch.
Does importing a repo keep my commit history?
No. The rebuilt project syncs to a new repository, so its history starts with the import. Your original repository and its history stay on GitHub exactly as they were.
Does importing a project into Lovable cost credits?
Lovable's import docs say an import is treated as standard build usage and consumes credits. The amount depends on the size of the project and on how much Lovable has to rewrite.
What doesn't come across when I import code into Lovable?
Database records, user accounts and uploaded files are not in a code ZIP, and passwords and active sessions do not transfer. Lovable does not accept a single SQL dump of a whole database, so data has to be loaded table by table.
Why don't I see the import option in Lovable?
Lovable is rolling out project and website import gradually. If "Import project to Lovable" is not in the dashboard + menu, your account does not have it yet.
Can I work on a Lovable project in VS Code or Cursor?
Yes. Clone the synced repository, work locally, and push to the synced branch; those commits appear in Lovable. Avoid force-pushing, rebasing or squashing commits that are already on that branch.

Talk to a senior engineer — not a salesperson.

Book a free 30-minute audit call. We'll diagnose what's wrong and tell you exactly what it costs to fix.

Or hire a Lovable developer for the whole job →

Book a free audit call