Lovable GitHub Integration: Connect & Two-Way Sync
Connecting GitHub gives you a backup of every change, lets developers work in their own editor, and keeps everything in sync with Lovable.
Connect GitHub
- A workspace owner or admin opens Workspace settings → Git → GitHub → Add connection.
- In GitHub, choose the account or organisation, pick All repositories or Only select repositories, then click Install & Authorize.
- Open Project settings → Git → GitHub and click Connect next to that connection.
- Lovable creates a new private repository and starts syncing. You can also reach it from the + menu next to the chat, under Project → GitHub.
How the sync works
- Every change Lovable makes is committed to GitHub.
- Commits you push to the synced branch flow back into Lovable and its preview.
- Only one branch syncs at a time. Work on another branch shows up after you merge it, or switch the branch in project Git settings.
- The status card shows whether both sides match. Re-check only compares — it does not sync.
Things that surprise people
| Myth | Reality |
|---|---|
| Lovable imports my existing repo | No — it creates a new repository for the project |
| A push publishes my site | No — publish separately in Lovable |
| I can link two repos | No — one repository per project |
| Other branches appear | Only the synced branch appears |
Good habits
- Keep main as the synced branch and use pull requests for developer work.
- Never put secret keys in the code — add them in Lovable's secrets instead.
- Pull before you push so you don't fight Lovable's latest commits.
Frequently asked questions
Can I connect an existing GitHub repository?
No. Lovable creates a new repository for the project; you can copy your old code into it.
Is the repository private?
Yes, new repositories are private by default.
Do GitHub changes go live automatically?
They update the project and preview, but you must publish to update the live site.
Which branch does Lovable use?
One branch at a time, usually main. You can change it in project Git settings.
Who can connect GitHub?
Workspace owners or admins create the connection; project admins or owners connect the project.
Facts from Lovable's official documentation (docs.lovable.dev), checked October 2026. Lovable changes its product often — if a menu name differs, check the docs. LAST ZONE is an independent site and is not affiliated with Lovable.
LAST ZONE