Learn how to connect and sync your projects with GitHub repositories
Initiate GitHub Connection:
Authorize Lovable on GitHub:
Select GitHub Account/Org
Create the Repository
Verify the Link
main
branch (or master
, depending on your repo). If you push commits to other branches on GitHub, those changes will not appear in your Lovable project until they are merged into the default branch. For example, if you’re working on a feature/login
branch, Lovable won’t show those updates in the editor until you merge feature/login
into main
on GitHub. Similarly, Lovable will only push its changes to the default branch. Keep this in mind when using multiple branches. (See the FAQ on switching default branch if you need to change which branch Lovable syncs.)feature
branch, push it to GitHub, get it reviewed via a pull request, and then merge it to main
. Once merged, Lovable will pull in those changes so the running app updates. This way, teams can enforce code reviews and use GitHub’s project management, while still benefiting from Lovable’s rapid development capabilities.
main
gets updated"Fix signup form validation bug"
is much more useful than "update code"
. Good commit messages help team members (and your future self) understand the history of the project. They serve as documentation for the evolution of your app. If Lovable’s AI made a lot of changes in one go, consider breaking them into logical commits with messages for each major change, if you’re doing it manually. If commits are being generated automatically, you can always squash or edit them later on GitHub for clarity.git revert
locally and push. This will create a new commit that undoes the changes of the bad commit. Lovable will sync this revert commit and your project will go back to the previous behavior. Always test your app after a revert to ensure the issue is resolved and no other functionality is affected.Why aren’t my commits showing up in Lovable?
main
or master
). If you committed to a different branch and haven’t merged those changes into the default branch, Lovable will not see them. To fix this, merge the branch into the default branch (or change the default branch – see the next question). Once the commit is on the default branch, Lovable should pull it in automatically.Another possibility is an issue with the integration link. For instance, if you renamed the GitHub repository or changed your GitHub username after connecting, the webhook/connection might be broken. In such cases, reconnecting your GitHub account to Lovable can re-establish the link. Make sure the Lovable GitHub App still has access to the repo (check your GitHub settings → Applications). If it was removed or lost access, re-authorize it and then try pushing the commit again.Also, double-check that the commit was successfully pushed to GitHub (not just committed locally). If you haven’t run git push
(in case of local development), the commit won’t be on GitHub for Lovable to detect.If your commits are on the default branch and you still don’t see updates in Lovable, try manually refreshing the project in the Lovable editor. In rare cases, there might be a slight delay or a hiccup in the webhook. Usually, though, commits appear almost instantly when everything is set up correctly.How do I switch the default branch that Lovable syncs with
main
(for new GitHub repos) unless you changed it. If you want Lovable to track a different branch (say you want to use a development
branch as the main source), you need to change the default branch on GitHub:How does Lovable detect new commits from GitHub?
Can I host my Lovable app myself after connecting to GitHub?