Sync with GitHub or another Git host
Linking keeps a Luzbase project and a repository in sync both ways. Versions you save in Luzbase are pushed to the repository, and commits pushed to the repository come into Luzbase. When both sides changed, nothing is overwritten: the other side’s work arrives as a pull request in Luzbase.
Only the project owner can link a repository, it needs Pro, and Git must be on for the project.
Connect GitHub
Section titled “Connect GitHub”Connecting GitHub lets you pick repositories from a list, create new ones from Luzbase, and get new commits instantly. It uses the Luzbase app on GitHub, so you choose exactly which repositories Luzbase can see. Connecting works on every plan.
- Open Account settings → Git.
- Under Git providers, click Connect next to GitHub.
- Install the Luzbase app on your GitHub account or organisation, and pick the repositories it may use.
- Back in Luzbase, the row shows Connected.
Click Add an account to install the app on another account or organisation, and Configure access for account to change which repositories it can see. If you install it on an organisation that needs approval, Luzbase shows Waiting for approval. Connect again once an owner of the organisation approves it. To remove the connection, click Disconnect.
For any other host, such as GitLab, Codeberg, Gitea, Bitbucket or a self-hosted server, you don’t need to connect anything. You use the repository’s HTTPS address and an access token with write access.
Link a repository
Section titled “Link a repository”- On the project page, open Settings → Git.
- Under Linked repository, click Link a repository, or Create on GitHub or GitLab to create a new, empty one.
- In the dialog, choose Existing repository or Create a new one:
- Existing repository: pick it on the GitHub tab, or enter its HTTPS address and a token on the URL tab.
- Create a new one: choose the owner under Where to create it, enter a Repository name, and choose whether it’s a Private repository (on by default). This needs a connected GitHub account.
- Choose whether to Pull changes automatically and Push versions automatically (see Sync options).
- Click Link repository or Create and link.
If the repository is empty, Luzbase pushes every branch to it. If it already has content, that content comes in on a branch named after the host, through a pull request in Luzbase for you to review and merge.
You can also turn on sync while you import a repository.
Sync options
Section titled “Sync options”Once a repository is linked, its card on Settings → Git shows these switches.
| Option | What it does | Default |
|---|---|---|
| Pull changes automatically | Commits pushed to the repository come into Luzbase on their own. If they collide with work in Luzbase, a pull request opens instead. | On |
| Push versions automatically | Every version saved in Luzbase is pushed to the repository. When it’s off, push from the editor’s Git panel. | Off |
| Mirror branch deletions | Deleting a branch in Luzbase deletes the branch it syncs with in the repository too. Off, the repository’s branch is left alone. | Off |
GitHub tells Luzbase about new commits straight away. For other hosts, copy the URL under Webhook for instant pulls and add it as a push webhook on the host. Without it, Luzbase checks for new commits every 10 minutes.
Choose which branches sync
Section titled “Choose which branches sync”The Branches table lists each Luzbase branch, the repository branch it syncs with, and a Sync switch. A branch that’s off stays in Luzbase only.
By default each branch syncs with the branch of the same name. If the repository’s default branch isn’t called main, Luzbase’s main is mapped to it. Change the names or switches and click Save mapping. Keep at least one branch in sync, or unlink the repository.
Pull and push from the editor
Section titled “Pull and push from the editor”The Git button in the editor header shows the sync state with a coloured dot, for example “In sync with GitHub” or “GitHub has new commits”. Click it to open the Git panel, which shows the clone URL, the linked repository and the branch’s Git-only files.
On a branch that syncs, editors and owners see Pull and Push:
- Pull brings in the repository’s new commits now, without waiting.
- Push saves your unsaved changes as a version first, then pushes it to the repository.
When both sides changed
Section titled “When both sides changed”If the repository and Luzbase both changed the same branch, Luzbase doesn’t overwrite either side. It brings the repository’s version into a new branch, for example github-sync/main, and opens a pull request in Luzbase.
- Open the pull request from the project’s Pull requests tab, or click Resolve in pull request in the editor’s Git panel.
- Review the changes. If the same lines changed on both sides, resolve the conflicts.
- Merge it. Luzbase pushes the merge back to the repository, and both sides are in sync again.
If the owner’s plan changes
Section titled “If the owner’s plan changes”Sync runs on the project owner’s Pro plan. If the owner moves to Free, automatic pulls and pushes stop and Pull and Push are no longer offered. The link, the project and the repository all stay as they are, and clone and fetch still work. Sync picks up again when the owner upgrades.
Unlink a repository
Section titled “Unlink a repository”On Settings → Git, click Unlink on the repository card and confirm. The project stops syncing. Its history, its branches and the repository all stay as they are. You can link it again later.