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.
| What you want to do | Possible? | What actually happens |
|---|---|---|
| Connect Git sync to an existing repo | No | Connecting a project always creates a new repository (GitHub, GitLab or Bitbucket), private by default on GitHub |
| Bring an existing repo's code into Lovable | Yes, as a ZIP import | Download 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 project | No | The rebuilt project syncs to a new repository; the old repository keeps its history untouched |
| Pull commits from GitHub back into Lovable | Yes | Sync is two-way on one branch: commits pushed to the synced branch appear in Lovable |
| Edit the project in VS Code or Cursor | Yes | Clone the synced repository and push to the synced branch; other branches sync only after you merge them |
| Bring database rows, users and uploaded files | No | A 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.
- On GitHub, open the repository and click Code → Download ZIP.
- Remove .env files, node_modules and build output from the ZIP, as Lovable's docs advise. The ZIP can be at most 250 MB.
- In Lovable, open the + menu on the dashboard, choose Import project to Lovable, then Upload code under "Code & web".
- 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.
- Add your secrets and API keys to the new project yourself; they should not have been in the ZIP.
- If the app had a database, load the data table by table: Lovable does not accept a single SQL dump of the whole database.
- Connect Git sync: Project settings → Git → GitHub → Connect. Lovable creates a new private repository and starts two-way sync.
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.
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.
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?
Can I connect Lovable to an existing GitHub repository?
Does Lovable sync changes from GitHub back into the editor?
Does importing a repo keep my commit history?
Does importing a project into Lovable cost credits?
What doesn't come across when I import code into Lovable?
Why don't I see the import option in Lovable?
Can I work on a Lovable project in VS Code or Cursor?
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.