Skip to content
Every tutorial here is 100% free — and always will be
LSLovableStudent

How do I connect Lovable to GitHub?

Last checked 31 Aug 2026

Short answer

Open your project's Settings, go to the GitHub/Git sync integration, authorise Lovable's GitHub app, and choose or create the repository to sync with — Lovable then keeps code in sync both ways automatically.

Steps

  1. Open your project in Lovable and go to Settings → GitHub (or the Integrations/Connectors area, depending on version).
  2. Click to connect GitHub and authorise the Lovable GitHub App via OAuth — you may need organisation admin approval if the target account is a GitHub organisation.
  3. Choose to create a new repository or connect an existing one.
  4. Lovable pushes the current project code to that repository and Git sync is now active.

GitHub Enterprise Cloud and GitHub Enterprise Server are also supported, alongside GitLab, if your organisation uses those instead.

Connect this project to a new GitHub repository under my account and keep it private.

What happens after connecting

Every change made in Lovable (by you or the AI) is automatically committed and pushed to the connected repository, and commits pushed to GitHub from elsewhere are pulled back into Lovable — it's a genuine two-way sync, not a one-off export.

Before you connect

  • Decide whether the repo should be private or public.
  • If you already have code in an existing repo you want to keep, be aware connecting can overwrite or need reconciling with what's there — start from an empty repo where possible to avoid conflicts.

What usually goes wrong

  • Trying to connect a GitHub organisation without admin rights to approve the app installation — ask an org admin to authorise it first.
  • Connecting an existing non-empty repository and getting unexpected merge conflicts — prefer a fresh repo unless you know what you're doing.
  • Assuming connecting to GitHub replaces Lovable's own version history — it doesn't; both exist alongside each other.

See also does Lovable automatically sync with GitHub for exactly how sync behaves after the initial connection.

What connecting GitHub gives you

  • A real repository containing your project's code, updated as you build
  • Version history outside Lovable, with commits and diffs
  • The ability to work in an editor such as Cursor or VS Code, or hand the code to a developer
  • A backup that exists independently of the platform

Changes sync in both directions: Lovable pushes what it builds, and commits you make in the repository come back into the project.

Connect it early

Connect before you start editing outside Lovable. Connecting late is still fine, but the first sync is cleaner when the repository begins as a copy of your project rather than merging two histories.

Working in both places without conflicts

  • Pull before you start editing locally, push in small commits
  • Do not edit the same file in Lovable and locally at the same time
  • Let generated files regenerate — do not hand-edit them
  • Keep dependency changes in one place so lockfiles do not conflict
  • If a sync looks stuck, check the repository's latest commit before re-prompting

When changes do not appear

The usual causes: the sync is still running, you are looking at a different branch, or a local commit was never pushed. Check the repository first, then the project — that tells you which side is behind. A failed build after a local edit is nearly always a syntax or import error in the file you touched.

Do you own the code?

Yes — the code in the repository is yours to keep, host and modify. That is the practical value of connecting: your project is never locked inside one editor.

Sources

Was this answer helpful?

Related questions

Website made, maintained and hosted by PromptSites.com

PromptSites logo