App Finishers

Fix guide · updated 2026-11-08

Lovable GitHub connection not working: sync, missing commits and reconnect fixes

GitHub is N commits ahead of Lovable · Lovable and GitHub have diverged · This repository is no longer accessible

You connected your Lovable project to GitHub and it doesn't work. Clicking Connect GitHub does nothing, the commits you push never show up in Lovable, or the project's GitHub settings say GitHub is N commits ahead of Lovable, Lovable and GitHub have diverged or This repository is no longer accessible. Each message has its own cause. The usual reflex, disconnecting and connecting again, often makes things worse. Here's how to find the cause and fix it.

First, how the connection works

Lovable keeps two separate links, and each problem breaks one of them:

Open Project settings → Git → GitHub, or the + button next to the chat input, then Project → GitHub. The status and the sync card there tell you which section below to read.

Don't disconnect the project to "reset" it. The Reconnect button Lovable shows when the connection has a problem is safe: it restores access to the same repository. But Disconnect followed by Connect never relinks your repository. Lovable creates a brand-new one, and the old one stays on GitHub, unlinked, with its history.

Only want a copy of your code? You don't need GitHub for that: on paid plans, use Download codebase in Project settings → Git.

1. "Connect GitHub" does nothing, or there's no GitHub option

2. You want Lovable to use a repository you already have

Lovable can't link a project to an existing repository. Git sync always creates a new one, private by default, in the account or organization you pick. To bring existing code in:

  1. On the repository's GitHub page, click Code → Download ZIP.
  2. In Lovable, import it with Upload code. This copies the code into a new project.
  3. Connect GitHub to that new project. Lovable creates a fresh repository and keeps it in sync from then on.

The ZIP carries your files, not your commit history: the original repository keeps that.

3. Your commits don't show up in Lovable

Check the branch first. Lovable syncs only the branch shown in the branch picker of its GitHub settings. Commits anywhere else, such as a feature branch or a pull request that isn't merged, never come back into Lovable. Either merge them into that branch (for example, merge your pull request into main), or select their branch in the picker: Lovable then edits and syncs that branch instead.

If you did push to the synced branch and the sync card says GitHub is N commits ahead of Lovable, Lovable missed GitHub's notice about your push. Lovable pulls changes when GitHub notifies it of a push, and it won't fetch a missed push later on its own. Reconnect doesn't help, and Re-check only compares the two sides. What works is a new push to the synced branch, even an empty one:

git commit --allow-empty -m "Trigger Lovable sync"
git push

Lovable then syncs the branch to its current state on GitHub, earlier commits included. Before you push, make sure your latest Lovable edits are already on GitHub. If the card says the two sides have diverged, read section 4 first.

4. "Lovable and GitHub have diverged", or a lovable-sync branch appeared

Both sides have commits the other doesn't. Maybe you kept editing in Lovable while someone pushed to the same branch, or a branch protection rule refused Lovable's push. So that nothing is lost, Lovable pushes its changes to a branch named lovable-sync and shows Your changes conflict with commits on <your branch> and could not be merged automatically. To fix it:

  1. On GitHub, open the lovable-sync branch and review what Lovable changed.
  2. Merge it into your synced branch with a pull request, and resolve any conflicts there.

Watch out: the next sync from GitHub replaces Lovable's version of the branch with GitHub's. Edits made only in Lovable disappear from the project if they never reached GitHub. Lovable saves a backup first, and the project owner can restore it. If a later push is refused too, Lovable adds it to the same lovable-sync branch, or to a new lovable-sync-<timestamp> branch if you've committed to lovable-sync yourself.

5. Lovable shows a Reconnect prompt

When the workspace connection breaks, the project's GitHub settings show Reconnect with one of these messages. A workspace owner or admin fixes it once, and every project on that connection resumes.

6. "This repository is no longer accessible"

The repository was deleted, or transferred to an account or organization your workspace has no connection for. Two ways out:

Renaming doesn't cause this. Some older answers say a rename breaks the sync for good, but Lovable's current docs say a renamed repository, account or organization keeps syncing and Lovable updates the link itself. A transfer keeps syncing only if your workspace also has a GitHub connection for the new owner, so add that connection first, then transfer.

7. Other things that stop the sync

Still stuck?

Check status.lovable.dev: during a Lovable incident, sync can stop for everyone. Then compare the sync card in Project settings → Git → GitHub with your repository's commit list on GitHub. Lovable's own commits come from lovable-dev[bot], so you can tell which side has what. If the two still don't match after a new push to the synced branch, contact Lovable Support.

Other Lovable app problems? See Fix a Lovable app.