Lovable GitHub sync is behind, diverged, or created a new repo

GitHub and Lovable don't match? Lovable syncs one branch, won't reattach an old repo, and replaces its copy if you rewrite history.

Reviewed October 14, 2026

What it means in plain English

Lovable can keep a GitHub repository in step with the project, both ways. When that stops, the usual cause is which branch is synced, a missed GitHub notification, or a disconnect that started a brand-new repository. Lovable's docs are explicit: you cannot import an existing repo, and you cannot reconnect the old one.

Likely causes

  • Commits went to a branch Lovable is not syncing. Only the active branch is edited and pulled. Other branches stay invisible until you merge them in or switch the picker.
  • The status card says the two sides diverged. Lovable then pushes its own commits to a lovable-sync branch instead of the synced branch. The next sync from GitHub replaces Lovable's copy of that branch.
  • GitHub is "N commits ahead" because Lovable never got the push notification. Reconnect and Re-check do not pull those commits.
  • Someone force-pushed, rebased, or squashed commits that were already on the synced branch. Lovable keeps its own copy of that history.
  • The project was disconnected and connected again. Lovable creates a new repository. The original stays on GitHub, unlinked.

How to fix it, step by step

  1. Open the project → Project settings → Git → GitHub. Read the active branch and the sync status.
  2. If your commits are on another branch, merge them into the synced branch (often main) or switch Lovable's branch picker to the branch that has the commits.
  3. If GitHub is ahead and the commits never appeared, push one new commit to the synced branch, including an empty commit if you have nothing else to push. Lovable's GitHub guide says that new push is what makes it pull the earlier commits too. Confirm you are not about to overwrite Lovable edits you still need.
  4. Don't force-push, rebase, or squash the synced branch. Add a revert commit instead. If a rewrite already happened, the project owner can restore the backup Lovable saved.
  5. If you disconnected, leave the old repository as your archive. The new link is a new repository with the project's current code. Connecting never imports a repo you already had.
  6. A project can use one Git provider at a time. Disconnect before switching to GitLab or Bitbucket.

How to check it worked

  • The sync card no longer says the sides have diverged or that GitHub is ahead.
  • A small edit in Lovable shows up on the active GitHub branch, and a commit on that branch shows up in Lovable after the push notification.

Sources

Can't fix it? Get help.

If the steps didn't clear the error, send what the screen says. A person can take a look. This is a request for a paid fix, not an instant chat.

Request a fix