VOOZH about

URL: https://docs.lovable.dev/integrations/github

⇱ Connect to GitHub - Lovable Documentation


Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

Skip to main content
When you build with Lovable, your project code is stored and managed inside the Lovable platform. If you want your own copy, plan to collaborate with developers, or move your project elsewhere, you can export and sync your project to GitHub.

Why connect Lovable to GitHub

Connecting your Lovable project to GitHub lets you:
  • Back up your code: Store your project safely outside Lovable.
  • Collaborate easily: Invite developers, use pull requests, branches, and code reviews.
  • Sync changes automatically: Edits in Lovable appear in GitHub, and changes pushed to the active GitHub branch sync back into Lovable.
  • Work locally in your IDE: Clone, edit, and commit in your IDE while keeping your project synced.
  • Deploy outside Lovable: Self-host or deploy to alternative platforms, see Deployment, hosting, and ownership options with Lovable Cloud.
  • Test safely: Use branches and pull requests to develop features on a separate branch before merging changes to your live project.
  • Keep a copy of your code within your own infrastructure (Enterprise): connect to GitHub Enterprise Cloud with data residency, or to GitHub Enterprise Server running on your own hardware.
You don’t need GitHub to use Lovable. Many users build and launch entirely within Lovable. If you only need a copy of your code, you can download your code directly from Lovable. Open the Code editor and click Download codebase at the bottom of the file tree sidebar (paid plans).

How GitHub integration works

Lovable’s GitHub integration has two layers:
  1. A workspace connection
  2. A project repository link

Workspace connection

A workspace connection authorizes Lovable to access a GitHub account or organization through the Lovable GitHub app. This grants Lovable permission to create and update repositories in your chosen account or organization. Workspace connections are shared across the workspace and can be reused by multiple projects. A workspace can contain:
  • Multiple GitHub connections
  • Multiple GitHub accounts and organizations
  • Multiple GitHub connection types
This is useful if your team works across personal accounts, client accounts, or multiple organizations.

Project repository connection

A project repository connection links one Lovable project to one GitHub repository. When connected:
  • Changes made in Lovable sync to GitHub
  • Changes pushed to the active GitHub branch sync back into Lovable
  • Lovable only edits and syncs one branch at a time

GitHub connection types

Lovable supports three GitHub connection types:
  • github.com (available on all plans)
    The standard hosted GitHub platform used by most teams. Lovable manages the GitHub app installation for you.
  • GitHub Enterprise Cloud - Data residency (available on the Enterprise plan)
    GitHub Enterprise Cloud using a *.ghe.com hostname so repository data stays in a specific region. Lovable manages the GitHub app installation for you.
  • GitHub Enterprise Server (available on the Enterprise plan)
    Self-hosted GitHub running on infrastructure your organization controls. With this setup, you create your own copy of the Lovable GitHub app inside your GitHub organization, so credentials remain under your control.
When you add a new connection, you choose which type to set up. All three types support the same two-way sync, branch operations, and pull request creation between Lovable and your GitHub repository.

Role-based access for GitHub integration

RoleAllowed action
Workspace owner or admin only
  • Install the Lovable GitHub app on a new account or organization
  • Add a workspace connection
  • Update a workspace connection
  • Reconnect a workspace connection (re-authorize the GitHub app for the workspace connection)
  • Delete a workspace connection
  • Workspace owner or admin
  • Project owner or admin
  • Connect a project to a repository
  • Disconnect a project from a repository
  • Reconnect a project to a repository
  • Workspace editor or higher
  • Project editor or higher
  • View sync status
  • Switch branches
  • Create branches
Any workspace member, including external collaboratorsView the connection in Workspace settings → Git → GitHub (read-only mode)

Create a workspace GitHub connection

Workspace admins and owners can create workspace connections from:
  • Workspace settings → Git → GitHub → Add connection
  • Project settings → Git → GitHub → Add connection (if a project has not been connected yet).
To use an existing GitHub installation, click Connect next to the account or organization you want to use. The list shows installations on accounts and organizations you have access to on your GitHub identity.
If someone else installed the Lovable GitHub app on an organization you’re not a member of, you won’t see that installation. Ask them to add you to the GitHub organization, or to set up the Lovable workspace connection themselves.
To set up a new connection, follow the steps for your connection type:
  • github.com
  • GitHub Enterprise Cloud (data residency)
  • GitHub Enterprise Server
github.com is the standard hosted GitHub service used by most teams. Available on all plans. You need to have a GitHub account. You can create one for free at github.com.
1

Add account

Click Add account.
  • On Free, Pro, and Business plans, you’ll go straight to the github.com installation flow.
  • On Enterprise plan, Lovable shows three connection types. Select github.com.
2

Install and authorize the Lovable GitHub app

A GitHub popup opens.
  • Choose the account or organization.
  • Choose All repositories or Only select repositories.
  • Click Install & Authorize.
Lovable automatically detects the installation and adds it as a reusable workspace connection. You can now link projects to repositories under this account or organization.

Connect a project to GitHub

When there is an active workspace GitHub connection, workspace or project admins and owners can connect a Lovable project to a GitHub repository.
  • Connecting a project creates a new GitHub repository.
  • Each Lovable project can connect to one repository.
1

Open the project's GitHub settings

You can access project GitHub settings from:
  • Project settings → Git → GitHub
  • The + (plus) menu in the chat
2

Connect the project

Existing workspace connections appear under Accounts.Click Connect next to the workspace connection where the new repository should be created.Lovable creates a new GitHub repository and starts two-way sync automatically.
Don’t rename, move, or delete your GitHub repository after connecting. Doing so will break the sync, and Lovable won’t be able to update your project.

Manage a project’s repository connection

After connecting a project to a GitHub repository, you see the following in the project’s GitHub settings:
  • Repository status as Connected
  • Branch picker with active branch name (GitHub branch synced with Lovable)
  • Clone URLs (HTTPS, SSH, GitHub CLI)
  • Option to View on GitHub (available from the dropdown)
  • Option to Disconnect (available from the dropdown)
Lovable only edits and syncs one branch at a time. By default, this is the repository’s default branch (usually main). Changes pushed to the currently active branch sync back into Lovable.

Switch branches

  1. Click the branch picker.
  2. Search or select a branch.
  3. Click the branch to switch.
Lovable immediately starts editing and syncing the branch you switched to. You can switch back to the default branch at any time.

Create a new branch

  1. Click the branch picker.
  2. Click + Create branch at the bottom of the list.
  3. Enter a branch name. Lovable validates it against empty names, invalid characters, and duplicates.
    Branch names must follow Git naming rules (no spaces, .., leading or trailing dots or dashes, and special characters like ~ ^ : ? * [ ] \).
The new branch is created from the currently active branch as its source (shown as Source: <active branch> in the dialog). Lovable automatically switches to the new branch and starts editing and syncing it.
The source is your currently active branch, not the repository’s default branch. If you want to start a new feature branch from main, switch to main first, then create the new branch.
You can’t switch branches or create new branches while Lovable is editing the project.

Clone the repository locally

After connecting a project, Lovable provides clone URLs for:
  • HTTPS
  • SSH
  • GitHub CLI
You can clone the repository locally and continue working in your preferred IDE.

View the repository on GitHub

You can quickly access the synced repository directly in GitHub from Project settings → Git → GitHub. Use View on GitHub from the repository connection dropdown. This opens GitHub in a new tab.

Commit attribution

Commits made by Lovable are authored by the Lovable GitHub app identity:
  • lovable-dev[bot] for github.com and GitHub Enterprise Cloud
  • <your-app-name>[bot] for GitHub Enterprise Server
Commits are also co-attributed to the Lovable user who triggered them using GitHub’s noreply email format.

Disconnect a project from a GitHub repository

Disconnecting removes the sync relationship between a Lovable project and a GitHub repository. When you disconnect:
  • Sync stops. The two-way connection between Lovable and GitHub ends.
  • Your repository stays on GitHub. It remains intact with all history and files.
  • Your project and its code stay in Lovable. Future changes are stored only inside Lovable.
Disconnecting a project does not remove the workspace connection itself. There are two ways to disconnect a repository connection.
  • Disconnect from the project GitHub settings
  • Disconnect from the workspace GitHub settings
Workspace or project admins and owners can disconnect from the project’s GitHub settings.
1

Open GitHub settings

You can access project GitHub settings from:
  • Project settings → Git → GitHub
  • The + (plus) menu in the chat
2

Disconnect the project

In the active repository connection, open the dropdown and select Disconnect.
3

Confirm

  • Type the required info
  • Click Disconnect to confirm
If a project needs GitHub again, you can link it to any available connection. If you reconnect later:
  • Lovable creates a new repository with the current version of your project.
  • The original repository stays unchanged on GitHub and is no longer linked to Lovable.

Delete a workspace GitHub connection

Workspace admins and owners can delete GitHub connections. Deleting a workspace GitHub connection:
  • Removes the connection for all projects
  • Stops syncing for linked projects
  • Does not delete repositories on GitHub
  • Deletes stored credentials
  • For GitHub Enterprise Server, deleting a connection also schedules destruction of the stored GitHub app signing key.
1

Open GitHub settings

Go to Workspace settings → Git → GitHub.
2

Open the connection you want to remove

Select the connection from the list.
3

Review linked projects

Review the list of linked projects carefully before deleting the connection to avoid unintentionally removing GitHub sync.
4

Delete

Under Delete this connection:
  • Click Delete
  • Type the required info
  • Click Delete to confirm the deletion

Limitations

The GitHub integration currently does not support:
  • Importing existing GitHub repositories into Lovable. You can only export from Lovable to GitHub.
  • Reconnecting to the same repository after disconnecting. A new repository is created on reconnect.
  • Installing the Lovable GitHub app multiple times on the same account or organization.

Troubleshooting

When something goes wrong, Lovable shows a Reconnect prompt in the affected project’s GitHub settings.

Workspace connection issues

These problems affect the workspace-level GitHub connection itself, so the fix usually applies to every project linked to that connection. A workspace owner or admin only needs to perform the fix once from any affected project, and the other projects on the same connection resume automatically.

Project repository issues

These problems affect a single project’s link to its repository. Workspace or project admins and owners can resolve them from the project’s GitHub settings.

FAQ

Was this page helpful?

⌘I
Assistant
Responses are generated using AI and may contain mistakes.