When you build with Lovable, your code lives inside the Lovable platform — perfect for most creators. If you want your own copy, plan to collaborate with developers, or move your project elsewhere, you can export and sync everything to GitHub in just a few clicks.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.
About GitHub
GitHub is a cloud-based platform for storing, managing, and sharing code. It keeps track of every change, supports collaboration, and integrates with popular deployment tools like Vercel and Netlify. Think of it as Google Drive for code, built for developers.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 automatically: Edits in Lovable appear in GitHub, and changes in GitHub sync back on the default branch (
main). - Work locally: Clone, edit, and commit in your IDE while keeping your project synced.
- Deploy anywhere: Self-host or deploy to alternative platforms, see Self-hosting: Run your Lovable Cloud project anywhere.
- Test safely: Use GitHub branch switching to develop features on a separate branch before merging changes to your live project.
Before you connect
Make sure you understand how the integration works:- GitHub account required: Create one for free at github.com.
- Single source of truth: When connected, your code lives in GitHub, not separately in Lovable.
- Two-way sync: Edits in Lovable appear in GitHub, and vice versa.
- Stable repo path: The connection depends on the exact GitHub repository name, location, organization, and account.
Set up the GitHub integration
Only workspace admins and owners can manage the GitHub integration, which includes adding accounts and organizations, and connecting or disconnecting projects. Connecting GitHub happens in three stages:- Link your GitHub account (OAuth authorization)
- Install the Lovable GitHub App on an account or organization
- Connect individual projects to repositories
Step 1: Connect your GitHub account
This step links your GitHub identity to Lovable through OAuth authorization.- Open Settings → Git → GitHub.
- Click Connect GitHub.
- Sign in to your GitHub account or authorize lovable.dev to verify your GitHub identity.
You then see an option to connect a project.
Step 2: Install the Lovable GitHub app
This step installs the Lovable GitHub App on your GitHub account or organization and grants permission for Lovable to create and update repositories there. You can install the app under your personal GitHub account or any organization where you have admin access.- Open Settings → Git → GitHub.
- Click Connect project.
- Click Add organizations and choose where to install and authorize lovable.dev — your personal account or one of your organizations.
- Select whether to give access to all repositories or only selected ones.
- Click Install & Authorize to grant Lovable permission to create and update repositories in your chosen account or organization.
Step 3: Connect a project to GitHub
This step links a specific Lovable project to a GitHub repository. Each Lovable project can have one linked repository.- Open Settings → Git → GitHub and click Connect project, or click the GitHub icon in the top-right corner of your project and click Connect GitHub.
- Choose the GitHub organization or account where your code should live.
- Click Transfer anyway to confirm transfer and set up a 2-way sync.
A new GitHub repository is created for your project, and sync begins automatically.
Disconnect your project from GitHub
Workspace admins and owners can disconnect projects from GitHub at any time in the project’s GitHub settings. 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 code stays in Lovable: Future changes are stored only inside Lovable.
- A new GitHub repository is created using your latest Lovable code.
- Your original repository stays on GitHub but is no longer linked to Lovable.
FAQ
Do I need to know GitHub to use this feature?
Do I need to know GitHub to use this feature?
Clicking 'Connect GitHub' does nothing — what’s wrong?
Clicking 'Connect GitHub' does nothing — what’s wrong?
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?
How can I switch to a different GitHub account?
How can I switch to a different GitHub account?
The repo ended up in the wrong organization — can I move it?
The repo ended up in the wrong organization — can I move it?
- Remix your project to create a new copy.
- Connect the new project to GitHub.
- Choose the correct organization during setup.
Lovable can’t access my repository — what should I do?
Lovable can’t access my repository — what should I do?
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?
Why don’t my commits appear in Lovable?
Why don’t my commits appear in Lovable?
main). Merge your branch into main or use branch switching inside Lovable.