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
- Open your project in Lovable and go to Settings → GitHub (or the Integrations/Connectors area, depending on version).
- 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.
- Choose to create a new repository or connect an existing one.
- 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
- AnswerCan I export my Lovable project?Yes. Sync the project to your own GitHub or GitLab repository, or download the codebase from the code editor. It is a standard project you can run anywhere.
- AnswerCan I use Cursor with Lovable?Yes. Use Git sync to push your Lovable project to GitHub, then clone that repo and open it in Cursor for local edits, which sync back to Lovable.
- AnswerCan I host Lovable code somewhere else?Yes. You can download your project's code or sync it to GitHub via Git sync, then deploy it to any host that supports a Node/Vite React app (Vercel, Netlify, your own server, and so on).
- AnswerDoes Lovable automatically sync with GitHub?Yes — once connected, Git sync is automatic and two-way: changes made in Lovable push to GitHub, and commits pushed to GitHub pull back into Lovable, with no manual export step required.