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: Enable experimental GitHub branch switching in Settings → Account → Labs to develop features before merging changes to your live project. See Labs for more information.
You don’t need GitHub to use Lovable — many users build and launch entirely within Lovable.
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 — 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.- Go to Settings → Integrations → 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.- Go to Settings → Integrations → 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.- Go to Settings → Integrations → 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.
You can’t disconnect a project if Lovable can’t reach the GitHub repository (for example, if it was renamed, moved, or deleted).
FAQ
Do I need to know GitHub to use this feature?
Do I need to know GitHub to use this feature?
No. Just connect and authorize — GitHub will safely store your code. You only need to learn GitHub’s features if you want to do more advanced things like branching or collaborating with other developers.
Clicking 'Connect GitHub' does nothing — what’s wrong?
Clicking 'Connect GitHub' does nothing — what’s wrong?
Your browser probably blocked the GitHub login popup. Allow popups for Lovable, then try again.
What happens if I rename, move or delete my GitHub repository?
What happens if I rename, move or delete my GitHub repository?
The connection will break. Your project will stop syncing, and you won’t be able to edit it in Lovable.To fix this, restore the repository to its original location with original name. If deleted, you can restore it on GitHub.
What happens if I rename my GitHub username or organization?
What happens if I rename my GitHub username or organization?
The connection will break. Your project will stop syncing, and you won’t be able to edit it in Lovable.To fix this, revert to the original GitHub user or organization name.
How can I switch to a different GitHub account?
How can I switch to a different GitHub account?
You can’t change the linked GitHub account once connected.
The repo ended up in the wrong organization — can I move it?
The repo ended up in the wrong organization — can I move it?
Not directly. Try this workaround:
- 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?
You’ve likely renamed, moved, or deleted the repo. Restore or revert any changes to the repo’s name, path, or owner, or restore the repository if it has been deleted and the project should work again.
Can I disconnect from GitHub?
Can I disconnect from GitHub?
Yes. Admins and owners can disconnect projects from GitHub at any time in your project’s GitHub settings. Your repository stays on GitHub, but syncing stops. If you reconnect later, a new repository is created.
Can I import an existing GitHub repo into Lovable?
Can I import an existing GitHub repo into Lovable?
No. You can only export from Lovable to GitHub, not the other way around.
Why don’t my commits appear in Lovable?
Why don’t my commits appear in Lovable?
Lovable only syncs the default branch (usually
main). Merge your branch into main or switch branches inside Lovable.