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.Documentation Index
Fetch the complete documentation index at: https://docs.lovable.dev/llms.txt
Use this file to discover all available pages before exploring further.
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 code inside your own infrastructure (Enterprise): connect to GitHub Enterprise Cloud with data residency, or to GitHub Enterprise Server running on your own hardware.
How GitHub integration works
Lovable’s GitHub integration has two layers:- A workspace connection
- 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
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.comhostname 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.
Role-based access for GitHub integration
| Role | Allowed action |
|---|---|
| Workspace owner or admin only |
|
|
|
|
|
| Any workspace member, including external collaborators | View 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).
- github.com
- GitHub Enterprise Cloud (data residency)
- GitHub Enterprise Server
- github.com
- GitHub Enterprise Cloud (data residency)
- GitHub Enterprise Server (self-hosted)
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.
Install and authorize the Lovable GitHub app
- Choose the account or organization.
- Choose All repositories or Only select repositories.
- Click Install & Authorize.
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.
Open the project's GitHub settings
- Project settings → Git → GitHub
- The GitHub icon in the top-right corner of the project’s toolbar. Click Connect GitHub.
- The
+(plus) menu in the chat
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)
main). Changes pushed to the currently active branch sync back into Lovable.
Switch branches
- Click the branch picker.
- Search or select a branch.
- Click the branch to switch.
Create a new branch
- Click the branch picker.
- Click + Create branch at the bottom of the list.
- 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 ~ ^ : ? * [ ] \).
Source: <active branch> in the dialog). Lovable automatically switches to the new branch and starts editing and syncing it.
Clone the repository locally
After connecting a project, Lovable provides clone URLs for:- HTTPS
- SSH
- GitHub CLI
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.
- The GitHub icon in the top-right corner of the project’s toolbar. Click the repository name. 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
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.
- Disconnect from the project GitHub settings
- Disconnect from the workspace GitHub settings
- Disconnect from project GitHub settings
- Disconnect from workspace GitHub settings
Open GitHub settings
- Project settings → Git → GitHub
- The GitHub icon in the top-right corner of the project’s toolbar. Click Configure.
- The
+(plus) menu in the chat
Disconnect the project
- 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.
Review linked projects
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 (and in workspace GitHub settings for connection-wide problems).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 can resolve them from the workspace GitHub settings.The Lovable GitHub app is suspended. Reconnect and unsuspend it to resume syncing.
The Lovable GitHub app is suspended. Reconnect and unsuspend it to resume syncing.
- Open Workspace settings → Git → GitHub.
- Open the affected connection and click Reconnect.
- Follow the link to your GitHub installation settings and unsuspend the Lovable GitHub app.
The Lovable GitHub app has been uninstalled. Reconnect to reinstall it and restore access.
The Lovable GitHub app has been uninstalled. Reconnect to reinstall it and restore access.
- Open Workspace settings → Git → GitHub.
- Open the affected connection and click Reconnect.
- Reinstall the Lovable GitHub app on the same account or organization when the GitHub popup opens.
Lovable no longer has access to this repository. Reconnect and grant access to it.
Lovable no longer has access to this repository. Reconnect and grant access to it.
- Open Workspace settings → Git → GitHub.
- Open the connection and click Configure on GitHub.
- Under Repository access, either select All repositories or add the missing repository to Only select repositories.
- Back in Lovable, click Reconnect to refresh access.
Install the GitHub app for <owner> to enable gitsync.
Install the GitHub app for <owner> to enable gitsync.
Clicking "Add account" or "Connect GitHub" does nothing.
Clicking "Add account" or "Connect GitHub" does nothing.
(Enterprise) My GitHub organization uses an IP allow list and the connection fails.
(Enterprise) My GitHub organization uses an IP allow list and the connection fails.
(Enterprise Server) The setup popup can't reach my instance.
(Enterprise Server) The setup popup can't reach my instance.
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.This repository is no longer accessible. Disconnect the project and connect it to a different repository.
This repository is no longer accessible. Disconnect the project and connect it to a different repository.
- Restore the repository on GitHub. Rename it back to its original owner, name, and path, or restore a deleted repository. Sync resumes automatically.
- Move on with a new repository. Open the project’s GitHub settings, disconnect the project, then connect it again. Lovable creates a new GitHub repository with your current code.
My commits and pushes from GitHub aren't showing up in Lovable.
My commits and pushes from GitHub aren't showing up in Lovable.
main).If you pushed commits to a different branch in GitHub, you have two options:- Merge your changes into the synced branch. For example, open a pull request from your feature branch into
mainand merge it. Lovable then picks up those commits. - Switch the synced branch in Lovable. In your project’s GitHub settings, select the branch where your commits live. Lovable starts editing and syncing that branch instead, and your commits will appear.
I see a "lovable-fallback" branch in the branch picker.
I see a "lovable-fallback" branch in the branch picker.
lovable-fallback so you can keep editing without errors. Your repository is otherwise untouched.Pick another branch or recreate the original branch. You can leave or delete lovable-fallback in GitHub once you’ve moved on.My push from Lovable ended up on a "lovable-sync-<timestamp>" branch instead of the synced branch.
My push from Lovable ended up on a "lovable-sync-<timestamp>" branch instead of the synced branch.
lovable-sync-<timestamp> branch instead.Open that branch on GitHub, review the changes, and merge them into your protected branch through your usual review process.FAQ
Do I need to know GitHub to use this feature?
Do I need to know GitHub to use this feature?
Do I need GitHub just to download my code?
Do I need GitHub just to download my code?
What's the difference between github.com, GitHub Enterprise Cloud, and GitHub Enterprise Server?
What's the difference between github.com, GitHub Enterprise Cloud, and GitHub Enterprise Server?
- github.com is the standard hosted GitHub service and is available on all plans.
- GitHub Enterprise Cloud (data residency) uses a
*.ghe.comhostname so your data stays in a specific region. It uses the Lovable-managed GitHub app. Available on the Enterprise plan. - GitHub Enterprise Server is GitHub running on your own infrastructure. You register your own copy of the Lovable GitHub app inside your organization. Available on the Enterprise plan.
What permissions does the Lovable GitHub app request?
What permissions does the Lovable GitHub app request?
- Contents (write): Read and write code in your repositories.
- Metadata (read): Basic repository information.
- Pull requests (write): Open and update pull requests.
- Workflows (write): Manage GitHub Actions workflow files.
- Administration (write): Create new repositories under your account or organization.
What happens if I rename, move, or delete my GitHub repository?
What happens if I rename, move, or delete my GitHub repository?
What happens if I rename my GitHub username or organization?
What happens if I rename my GitHub username or organization?
What happens if I transfer my project to another workspace?
What happens if I transfer my project to another workspace?
How can I switch to a different GitHub account or organization?
How can I switch to a different GitHub account or organization?
- Disconnect the project from GitHub in the project’s GitHub settings.
- Reconnect the project and choose a different installation during setup.
Can I connect multiple GitHub accounts or organizations?
Can I connect multiple GitHub accounts or organizations?
Can I disconnect from GitHub?
Can I disconnect from GitHub?
Can I import an existing GitHub repo into Lovable?
Can I import an existing GitHub repo into Lovable?
Can I edit a non-default branch from inside Lovable?
Can I edit a non-default branch from inside Lovable?
main) first.Are commits made by Lovable attributed to me?
Are commits made by Lovable attributed to me?
lovable-dev[bot]for github.com and GitHub Enterprise Cloud<your-app-name>[bot]for GitHub Enterprise Server
noreply email format.My GitHub Enterprise Server is behind a VPN or firewall. Will it work?
My GitHub Enterprise Server is behind a VPN or firewall. Will it work?
Where is my data stored for GitHub Enterprise Cloud (data residency)?
Where is my data stored for GitHub Enterprise Cloud (data residency)?
*.ghe.com hostname. Lovable’s backend connects to that hostname from the IP ranges shown in the setup wizard. If your organization enforces an IP allow list on GitHub, add those ranges to the allow list.