Module 14: Git Sync and Collaboration
Git sync connects one Lovable project to one repository and keeps the active branch synchronized in both directions. Lovable currently supports GitHub and GitLab. This module focuses on GitHub.
Connect a practice project to GitHub: Open Lovable.
Learning goals
- Understand workspace connections and project repository links
- Set up two-way GitHub sync
- Work safely with branches, local development, pull requests, and CI
- Avoid conflicts and distinguish Git sync from the GitHub API connector
1. How Git sync works
GitHub sync has two layers:
- A workspace connection authorizes Lovable to access a GitHub account or organization through the Lovable GitHub app.
- A project repository link connects one Lovable project to one repository.
A workspace can have multiple GitHub connections. Once a project is linked:
- Lovable changes are committed and pushed to the active branch.
- Commits pushed to that branch sync back into Lovable.
- Lovable edits and syncs one branch at a time.
Commits on other branches do not appear until you switch Lovable to that branch or merge them into the active branch.
Git sync is available across current plans. The code editor and one-time code download have separate plan requirements.
2. Why connect GitHub
- Keep code in an account you control
- Work in a local IDE
- Use branches and pull requests
- Review changes with developers
- Run CI and automated checks
- Deploy to external platforms
- Maintain an auditable history
You do not need GitHub to build or publish entirely within Lovable.
3. Connect a project
Workspace owners or admins create the GitHub workspace connection. Project or workspace owners and admins link or disconnect a project repository. Editors can work with the synced repository and view status.
Before linking:
- Confirm the target GitHub account or organization.
- Confirm repository visibility.
- Check organization policies and Lovable GitHub app access.
- Decide the initial active branch.
- Make sure no unrelated repository is selected.
After linking, verify a small Lovable edit appears as a commit in GitHub, then push a harmless GitHub edit and confirm it appears in Lovable.
4. Branch workflow
For a meaningful feature:
- Start from an up-to-date main branch.
- Create a feature branch in Lovable or GitHub.
- Switch Lovable to that branch.
- Build and test the feature.
- Open a pull request in GitHub.
- Review CI and code changes.
- Merge through GitHub.
- Switch Lovable back to main and confirm sync.
Use descriptive branch names such as feature/club-invitations or fix/member-book-access.
5. Local development
Clone the repository and follow its actual scripts: