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:
- The workspace connection: the Lovable GitHub App, installed on your GitHub account or organization. One connection serves every project in the workspace, so when it breaks, they all stop syncing.
- The project link: one Lovable project, one GitHub repository and one branch at a time, by default the repository's default branch (usually
main).
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
- Nothing happens when you click Add account or Connect GitHub. Your browser blocked the GitHub popup. Allow popups for Lovable and click again.
- No GitHub card in Project settings → Git. The project already syncs with GitLab or Bitbucket. A project links to one provider at a time, and the GitHub card only appears after you disconnect the other one.
- You can't add or change the connection. Only a workspace owner or admin can install the GitHub App and add a workspace connection. Connecting or disconnecting a project takes a workspace or project owner or admin. Editors can see the sync status and switch branches, nothing more. Ask the workspace owner.
- Your organization's connection isn't in the list. If someone else installed the Lovable GitHub App on an organization you're not a member of, you won't see it. Ask them to add you to the organization, or to set up the workspace connection themselves.
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:
- On the repository's GitHub page, click Code → Download ZIP.
- In Lovable, import it with Upload code. This copies the code into a new project.
- 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:
- On GitHub, open the
lovable-syncbranch and review what Lovable changed. - 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.
- The Lovable GitHub App is suspended. Click Reconnect. The app's settings on GitHub open in a new tab: unsuspend it there.
- Lovable no longer has access to this repository. Someone limited the app to Only select repositories and left yours out. Click Reconnect, then under Repository access choose All repositories or add your repository.
- Install the GitHub App for … to enable gitsync. This usually follows a workspace transfer, or a removed workspace connection. Click Reconnect and reinstall the app on the account or organization GitHub shows. Lovable relinks the project by itself.
- The Lovable GitHub App has been uninstalled. This one costs more. Uninstalling the app disconnected every project that used it and removed the workspace connection. Reinstall it from Workspace settings → Git → GitHub → Add connection, then click Connect in each project. Each project gets a new repository; the old ones stay on GitHub with their history.
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:
- Undo it on GitHub. Restore the deleted repository (GitHub's guide: Restoring a deleted repository), or transfer it back to its first owner. Sync resumes by itself.
- Start a new repository. Disconnect the project in its GitHub settings, then connect it again. Lovable creates a new repository with your current code.
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
- A
lovable-fallbackbranch appeared. Someone deleted the synced branch on GitHub, so Lovable moved the project to a newlovable-fallbackbranch to keep you editing. Pick another branch or recreate the original one. Once you've switched away, you can deletelovable-fallback. - "Your project contains files that exceed the maximum file size limit (100 MB)". GitHub refuses files over 100 MB. Delete the listed files, or ask Lovable to remove them, and let the sync retry. If it still fails, the file is stuck in the history and Lovable Support has to clean it up.
- A big file syncs in, but Lovable can't change it. Lovable can't save files over 10 MB. For images and video, ask Lovable to "Migrate large files to CDN assets".
- You want the project on another GitHub account. There's no switch. Disconnect, then connect again with the other installation: Lovable creates a new repository there.
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.