KBAISE/ for lovable
Library
Docs

Sync your Lovable project with GitHub

about 15 minBuildingchecked 2h agoOfficial page
The short version

You can connect your Lovable project to GitHub to automatically save your code, work with others, and use other tools. This creates a two-way sync, so changes in Lovable go to GitHub, and changes on GitHub come back to Lovable.

Anyone who wants to back up their Lovable project code, collaborate with developers, or use GitHub's features for their project needs this.

Do this, in order

  1. 1

    Go to your Workspace settings, then Git, then GitHub, and click 'Add connection'.

    This starts the process of linking your Lovable workspace to a GitHub account or organization, giving Lovable permission to manage repositories.

  2. 2

    Choose your GitHub connection type (github.com, GitHub Enterprise Cloud, or GitHub Enterprise Server) and follow the on-screen instructions to install and authorize the Lovable GitHub app.

    This establishes the main connection between Lovable and your GitHub environment, allowing Lovable to interact with your repositories.

  3. 3

    Once the workspace connection is active, go to your Project settings, then Git, then GitHub, and click 'Connect' next to the account you just linked.

    This creates a new, private GitHub repository for your specific Lovable project and starts the automatic two-way sync.

  4. 4

    To work on different versions of your project, use the branch picker in your project's GitHub settings to switch to an existing branch or create a new one.

    This allows you to manage different features or experiments without affecting your main project code, similar to how developers work.

Paste this into your project

I want to set up two-way sync between my Lovable project and GitHub. Please guide me through connecting my Lovable workspace to GitHub and then linking my project to a new GitHub repository. I'll be using github.com.

Words decoded

Workspace connection
This is the main link that lets Lovable talk to your GitHub account or organization. Once set up, multiple projects in your Lovable workspace can use it.
Project repository link
This is the specific link between one of your Lovable projects and one particular GitHub code storage area (called a repository).
Repository
A 'repository' is like a folder where all the code and files for a single project are stored and managed on GitHub.
Two-way sync
This means that any changes you make in your Lovable project are automatically sent to GitHub, and any changes made directly on GitHub are automatically brought back into your Lovable project.
Branch
A 'branch' is a separate line of development in your project's code. It allows you to work on new features or fixes without changing the main version of your project until you're ready.
IP allow list
A security setting that only permits network connections from specific, approved internet addresses (IP addresses). If your GitHub organization uses this, you need to add Lovable's addresses.

Where people get stuck

  • Do not delete your GitHub repository, rename your GitHub account or organization, or transfer the repository to another account or organization, as this will break the sync.
  • If you disconnect a project and then reconnect it, Lovable will create a *new* GitHub repository, not reuse the old one. The old repository will remain on GitHub but won't be linked.
  • You cannot import existing GitHub repositories into Lovable; you can only export from Lovable to GitHub.
  • You cannot install the Lovable GitHub app multiple times on the same GitHub account or organization.

The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.