Skip to main content
RapidDev - Software Development Agency
lovable-issues

Enabling GitHub Integration in Lovable

Enable GitHub integration in Lovable in three steps: 1) Connect your GitHub account via OAuth at Settings, then Connectors, then GitHub. 2) Install the Lovable GitHub App by clicking Connect project, then Add organizations, then Install and Authorize. 3) Connect your project by choosing your organization and clicking Transfer anyway. This creates a GitHub repository with two-way sync on the main branch. Never rename or delete the repository after setup.

Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate8 min read~5 minAll Lovable versions (workspace admin or owner required)March 2026RapidDev Engineering Team
TL;DR

Enable GitHub integration in Lovable in three steps: 1) Connect your GitHub account via OAuth at Settings, then Connectors, then GitHub. 2) Install the Lovable GitHub App by clicking Connect project, then Add organizations, then Install and Authorize. 3) Connect your project by choosing your organization and clicking Transfer anyway. This creates a GitHub repository with two-way sync on the main branch. Never rename or delete the repository after setup.

Why GitHub integration is essential for Lovable projects

GitHub integration transforms your Lovable project from a cloud-only prototype into a properly version-controlled codebase. Without it, your code lives exclusively inside the Lovable editor with no external backup and limited version history. Connecting to GitHub gives you a complete Git commit history, the ability to clone and work locally, CI/CD pipeline support, and collaboration with developers who use traditional IDEs. Lovable uses two-way sync on the default branch (main). Every AI change in Lovable creates a commit in GitHub, and every commit pushed to GitHub syncs back to Lovable. When connected, GitHub becomes the single source of truth for your code. The setup involves three distinct steps that often confuse users: connecting your GitHub account (OAuth), installing the Lovable GitHub App (permissions), and connecting the specific project (repository creation). Each step serves a different purpose and must be completed in order. The most common failure is skipping the GitHub App installation step, which prevents Lovable from creating repositories in your account.

  • OAuth not completed — the GitHub account is not connected to Lovable yet
  • GitHub App not installed — Lovable does not have permission to create repositories in your account
  • Wrong organization selected — the GitHub App is installed on a different org than the one you are trying to connect
  • Not a workspace admin — only workspace admins or owners can connect GitHub in Lovable
  • Repository renamed or deleted after connection — this permanently breaks the sync

Error messages you might see

GitHub connection failed: The GitHub App is not installed on this organization

You completed the OAuth step but did not install the Lovable GitHub App. Go to Settings, then Connectors, then GitHub, click Connect project, then Add organizations, and install the app on the correct account or organization.

Cannot find or access the repository

The connected GitHub repository was renamed, moved, or deleted. This breaks sync permanently. You will need to disconnect and reconnect, which creates a new repository. The old repository name will not be recoverable.

Merge conflicts: Lovable can't deploy if GitHub reports conflicts in your files

Changes were made simultaneously in Lovable and GitHub to the same files. Resolve the merge conflict in GitHub by editing the conflicting files, then Lovable will pull the resolved code automatically.

GitHub commit cards not rendering in the Lovable UI

This is a known platform issue that has affected GitHub-connected projects during several incidents. Check status.lovable.dev for any ongoing issues. Changes should still sync even if the UI does not show commit cards.

Before you start

  • A GitHub account (free or paid)
  • Workspace admin or owner role in your Lovable workspace
  • A Lovable project you want to connect to GitHub
  • The project must not already be connected to a different GitHub repository

How to fix it

1

Step 1: Connect your GitHub account via OAuth

OAuth lets Lovable verify your GitHub identity without accessing your password

Go to Settings (gear icon in the top-right corner of the Lovable editor), then Connectors, then GitHub. Click Connect GitHub. You will be redirected to GitHub's authorization page. Sign in to GitHub if prompted, then authorize lovable.dev to verify your identity. This step only links your GitHub account to Lovable — it does not create any repositories or give Lovable write access yet.

Expected result: Your GitHub username appears in the Settings Connectors page, confirming the OAuth connection is active.

2

Step 2: Install the Lovable GitHub App

The GitHub App gives Lovable permission to create and sync repositories in your account or organization

Go to Settings, then Connectors, then GitHub. Click Connect project. Click Add organizations and choose where to install the Lovable GitHub App — either your personal GitHub account or an organization you manage. Select whether to give access to all repositories or only selected ones (all repositories is simpler). Click Install and Authorize. This gives Lovable the ability to create repositories and push commits under your account.

Expected result: The Lovable GitHub App appears in your GitHub account's installed apps. Your organization or personal account shows as available when connecting a project.

3

Step 3: Connect your Lovable project to create a GitHub repository

This creates the actual GitHub repository and starts two-way code sync

Go to Settings, then Connectors, then GitHub and click Connect project. Alternatively, click the GitHub icon in the top-right corner of the project editor. Choose the GitHub organization or personal account where you installed the app. Click Transfer anyway to confirm. Lovable creates a new GitHub repository and pushes your entire project code as the initial commit. From this point forward, every AI change in Lovable appears as a commit in GitHub, and commits pushed to GitHub sync back to Lovable on the main branch.

Expected result: A new GitHub repository is created with your project code. The Settings page shows the repository as connected. Two-way sync is active on the main branch.

4

Troubleshoot common connection issues

Several common issues prevent successful GitHub connection — knowing the fixes saves time

If the Connect project button does not show your organization, the GitHub App is not installed there — go back to Step 2 and add the organization. If you see a 404 error when reinstalling the app, the previous installation may be stuck — go to GitHub Settings, then Applications, then Installed GitHub Apps, and remove the Lovable app, then reinstall from Lovable. If sync breaks after connecting, check that the repository was not renamed, moved, or deleted on GitHub. If you need help troubleshooting complex GitHub sync failures across a project with existing branch history, RapidDev's engineers can diagnose and fix the connection.

Expected result: The GitHub connection is established and two-way sync works. Commits from Lovable appear in GitHub and vice versa.

Complete code example

AGENTS.md
1# GitHub Sync Rules
2
3## Repository Safety
4
5- This project is connected to GitHub with two-way sync
6- GitHub is the source of truth for all code
7- NEVER suggest renaming, moving, or deleting the GitHub repository
8- NEVER suggest disconnecting from GitHub unless explicitly asked
9
10## Sync Behavior
11
12- Every Agent Mode change creates a GitHub commit automatically
13- External commits to the main branch sync back to Lovable
14- Only the default branch (main) syncs other branches do not affect Lovable
15- Branch switching is available via Settings Account Labs
16
17## Commit Conventions
18
19- Keep changes small and focused each prompt ideally maps to one logical commit
20- Add descriptive prompt text since it becomes the commit message
21- Avoid modifying many unrelated files in a single prompt
22
23## Conflict Prevention
24
25- Do not make changes in both Lovable and GitHub simultaneously
26- If someone pushes to GitHub externally, wait for it to sync before prompting
27- If a merge conflict occurs, resolve it in GitHub Lovable will pull the fix
28
29## Post-Export Notes
30
31- If cloning this repo locally, use Node.js 22 and run: npm install && npm run dev
32- Internal @lovable/* packages may need to be replaced with public alternatives
33- Environment variables are in .env (gitignored) copy from .env.example

Best practices to prevent this

  • Complete all three steps in order: OAuth, then GitHub App installation, then project connection
  • Install the GitHub App on the correct organization before trying to connect a project
  • Never rename, move, or delete the GitHub repository after connecting — this breaks sync permanently
  • Use the main branch for all Lovable work — Lovable only syncs the default branch
  • Enable branch switching in Settings, then Account, then Labs if you need to work on feature branches
  • Avoid making changes in both Lovable and GitHub simultaneously to prevent merge conflicts
  • If sync breaks, try making a small commit in GitHub to trigger a re-sync before disconnecting
  • Keep your prompts descriptive — the prompt text becomes the Git commit message in GitHub

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I am trying to connect my Lovable (lovable.dev) project to GitHub but running into issues. My situation: - GitHub account type: [personal / organization] - What I have done so far: [describe which steps you completed] - Error I see: [paste exact error message] - Workspace role: [admin / member] Please: 1. Identify which of the three setup steps I may have missed 2. Walk me through the exact fix for my specific error 3. Explain how to verify each step was completed successfully 4. Warn me about common pitfalls after connection (repo renaming, sync conflicts)

Lovable Prompt

Check if my project is properly connected to GitHub. In Plan Mode, tell me: 1) Is the GitHub integration active? 2) What repository is this project connected to? 3) Are there any pending sync issues or merge conflicts? 4) When was the last successful sync? Do not modify any code or settings — just report the current state.

Frequently asked questions

How do I set up GitHub integration in Lovable?

Complete three steps in order: 1) Go to Settings then Connectors then GitHub and click Connect GitHub to authorize via OAuth. 2) Click Connect project, then Add organizations, and install the Lovable GitHub App. 3) Click Connect project, choose your organization, and click Transfer anyway to create the repository and start sync.

Can I import an existing GitHub repository into Lovable?

No. Lovable only supports exporting from Lovable to GitHub, not importing. When you connect a project, it creates a new repository. To work with existing code, you would need to start a new Lovable project and recreate the features.

What happens if I rename my connected GitHub repository?

It breaks the sync permanently. Lovable cannot find the repository at the new name. You would need to disconnect the project in Lovable and reconnect, which creates a new repository from the current Lovable code. The renamed repository becomes disconnected.

Does Lovable sync all branches or just main?

Only the default branch (main) syncs by default. Changes on other branches do not appear in Lovable until they are merged to main. Branch switching is available as a Labs feature — enable it in Settings then Account then Labs.

Why does my GitHub connection keep disconnecting?

This usually happens when the Lovable GitHub App loses access — for example, after an organization rename or if someone revoked the app's permissions. Go to GitHub Settings then Applications then Installed GitHub Apps and verify the Lovable app is still installed. Reinstall if needed.

How do I resolve GitHub merge conflicts with Lovable?

Open your GitHub repository, find the conflicting files (marked with conflict markers), edit them to resolve the conflicts, and commit the resolution. Lovable automatically pulls the resolved code from the main branch. Avoid making changes in Lovable while conflicts are pending.

What if I can't get GitHub integration working?

If the connection fails after completing all three steps, or if sync breaks due to organization changes or permission issues, RapidDev's engineers can troubleshoot the integration. They have resolved GitHub sync issues across hundreds of Lovable projects.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your issue.

Book a free consultation

Need help with your Lovable project?

Our experts have built 600+ apps and can solve your issue fast. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.