Exporting a Lovable App to GitHub, and What to Check First

Arrie Burger--8 min read

To export a Lovable app, connect GitHub in Lovable's settings and it pushes your code to a repository it keeps in two-way sync. Paid plans can also download the codebase. The export takes minutes. What deserves your time is what comes next: secrets in the history, the database, sign-in settings, and everything that still lives only inside Lovable.

Most people export for one of three reasons. A developer is joining. An investor wants to see the code. Or the app has outgrown Lovable and is moving somewhere else. All three put the repo in front of new eyes, which is exactly when old mistakes get noticed. If the new eyes belong to an investor, read what their technical reviewer will ask first.

Details below come from Lovable's GitHub docs and related Lovable pages, last checked on 14 October 2026. Lovable changes often, so confirm a detail before you depend on it.

How does exporting a Lovable app to GitHub work?

You connect your Lovable workspace to GitHub once, then link each project to one repository. From then on, changes made in Lovable push to GitHub, and commits pushed to the active branch sync back into Lovable. On paid plans you can also download the code from the project's Git settings without using GitHub at all.

A few rules from Lovable's docs are worth knowing before you start.

One branch at a time. Lovable "only edits and syncs one branch at a time", by default the repository's default branch. You can switch branches in project settings.

Renames are safe, deletes aren't. If you rename the repository, "Sync continues". If you delete it, "The connection breaks and the project stops syncing" until you restore it.

No imports. You can't bring an existing repository into Lovable. The flow runs from Lovable to GitHub.

File size. GitHub rejects pushes with files larger than 100 MB, so large media belongs in storage, not in the repo.

Does the export include your database?

No. The export is your app's code. Your data lives in the backend, which is either Lovable Cloud or a Supabase project you connected yourself, and it stays there. Lovable's docs say there's "no one-click migration" between the two, so moving the data is a separate, deliberate job.

Lovable Cloud is built on Supabase's open-source foundation and managed by Lovable. Its docs offer a data export, but if you ever move your backend, several things travel separately. Lovable's hosting guide lists them: "secrets stored in Lovable are not part of the export", storage files must be downloaded and uploaded by hand, auth providers like Google sign-in must be set up again, and after a move "anyone signed in signs in again".

Backups follow the backend, not the repo. A GitHub copy protects your code, not your customers' records. Check what backups your backend actually has, and remember that Supabase's database backups "do not include objects you store via the Storage API". Uploaded files need their own copy.

So the repo on GitHub is half the app. If someone tells you the export "is the app", ask where the users, the files and the keys are.

Which secrets need rotating before anyone else sees the repo?

Rotate every secret that has ever appeared in the code, the commit history, a .env file or a project that was public, before you share access. Deleting a key from the latest version doesn't remove it from history. Replacing it with a new key is the only fix that holds.

GitHub's own guidance puts it in that order: "as a first step you need to revoke and/or rotate that secret." It also warns that rewriting history doesn't reach copies. If a commit "exists in any forks, it will continue to be accessible there", and anyone with an old clone can push it straight back.

GitHub's secret scanning "scans your entire Git history on all branches". It runs free on public repositories. Private ones need GitHub Secret Protection, through GitHub Team or GitHub Enterprise Cloud. If you have it, switch it on before the first developer arrives.

Three places to look by hand:

  • The Supabase client. The publishable key is meant to be public. The secret key skips every row-level security policy and must never be in front-end code.
  • VITE_ variables. Lovable's hosting guide says they "are embedded at build time". Treat every one as public.
  • Old prompts. Keys pasted into the chat while building can land in code you no longer use. Search the history, not just today's files.

One more reason to be thorough. Lovable's own account of an April 2026 incident says a regression exposed chat histories and source code of public projects created between 3 February and 20 April 2026. If your project was public in that window, assume its code was seen.

What should you check in the code before a developer starts?

Check four things before anyone builds on it: the database rules, the edge functions, the dependencies and who has access. Each one is fixable in a day. Found later, by a new developer under deadline, each one costs a week.

Database rules. Read the row-level security policies for every table and test them with two ordinary accounts. Lovable's docs call missing policies "the most common way app data gets exposed", and a 2025 scan found exposed data in 170 of 1,645 Lovable projects.

Edge functions. Every function that does something sensitive should check who's calling. Payments, emails and AI calls are the ones attackers try first, because they cost you money.

Dependencies. Run an audit of the packages in package.json and update anything with a known vulnerability. Then turn on automatic dependency alerts in GitHub.

Sign-in settings. These live in the backend, not the code, so a code review misses them. Check that email confirmation is on, emails come from your own domain, and the allowed redirect URLs list only addresses you own. A leftover preview URL in that list is an open door.

Access. List every person and app with access to the repository, the Supabase project and the Lovable workspace. Remove anyone who doesn't need it. Protect the main branch so nobody pushes to it without a review.

Before the repo leaves your hands

1

Rotate

Replace every key that ever touched the code or a public project

2

Scan

Turn on secret scanning and dependency alerts

3

Test the rules

Two accounts, every table, read and write

4

Lock access

Fewest people possible, protected main branch

5

Share

Now invite the developer, investor or reviewer

Can you keep building in Lovable after you export?

Yes. The sync runs both ways, so you can keep prompting in Lovable while a developer works in GitHub. It works best with one rule: Lovable owns one branch, developers work in their own branches, and changes reach the shared branch through a reviewed merge. Without that rule, two editors overwrite each other.

This is where a lot of exported apps get messy. The founder keeps prompting on main. The developer pushes fixes to main. Each undoes the other's work and nobody notices until something breaks. Agree the rule in week one and write it into the repo's README.

Add automatic checks that run on every push: the build, the tests you have, and a dependency audit. They catch the cases where a prompt quietly undid a fix. It's the same discipline as keeping automations maintainable: if nobody can see what changed, nobody can fix it.

When does an export become a move off Lovable?

An export becomes a move when you host the app and its backend yourself. That's a bigger job than the export: environment variables must be set before each build, sign-in redirect URLs and OAuth credentials need updating, secrets need re-entering, files need copying, and users sign in again. Lovable's docs are explicit that you then own backups, monitoring and security.

The hosting guide says it directly: "You are responsible for the backend capabilities Lovable previously managed." That's not a reason to stay. It's a reason to plan the move around your live users and data, with dates, before anything changes.

Most apps don't need to move yet. If you have real users and want it done properly first, the Lovable production checklist and the security question come before any move.

The export takes minutes. The keys you forgot about take a lot longer.

If you want someone to read the repo before you share it, our reviews for AI-built apps start from read access to your GitHub repo and end in a fixed quote for the next step. When the app is ready to leave, Graduate plans the move to your own database, hosting and repo. Our Lovable page covers what we usually find. If the app will answer your team's AI assistant, see AI connectors and how that works on a platform.

Export early. Share late. Rotate in between.

How we help with this

Want to discuss this topic?

If this resonates with where your company is right now, we'd like to hear from you.