Clone and push with Git
Once Git is on for a project, you can work on it from your own computer with any Git client: clone it, edit in your local editor, and push your commits back. Each commit you push becomes a version in Luzbase. Cloning and fetching work on every plan. Pushing needs Pro (see What each plan includes).
If Git isn’t on for the project yet, the owner can turn it on.
Create an access token
Section titled “Create an access token”Git asks for a username and password when you clone. Your username is your Luzbase email address, and the password is an access token.
- Open Account settings → Git.
- Under Access tokens, click New token.
- Fill in the New access token dialog:
- Name: a label such as “Laptop”, up to 60 characters.
- Access: Read only (clone and fetch) or Read and write (clone, fetch and push). Read and write needs Pro.
- Expires after: 30 days, 90 days (the default) or 1 year. Tokens always expire.
- Projects: All my projects, which includes projects shared with you later, or Only some projects, where you tick the projects the token may reach.
- Click Create token.
- Copy the token from Copy your new token. This is the only time it’s shown. Click I’ve copied it.
To stop a token working, click Revoke next to it. Git clients that use it stop working at once.
Clone a project
Section titled “Clone a project”Each project’s clone URL is on its Settings → Git page and in the editor’s Git panel.
git clone https://git.luzbase.com/<project-id>.git# Username: your Luzbase email# Password: your access tokenTo save the token so Git stops asking, you can use a credential helper, for example:
git config --global credential.helper storeEvery Luzbase branch comes with the clone. Switch between them with git switch <branch> as usual.
Push your changes
Section titled “Push your changes”Commit and push as you would to any Git host:
git add chapters/introduction.texgit commit -m "Tighten the introduction"git pushLuzbase turns each commit into a version on the matching branch, and everyone with the project open sees the new files. These rules apply:
- Only editors and owners can push, and the project owner needs Pro.
- Force pushes are refused, because Luzbase history is append-only. Run
git pull, then push again. - If Luzbase has newer versions of the branch, you get “Luzbase has newer versions of this branch: git pull first”.
- If the default branch is protected, you get “the main branch is protected: push a branch and open a pull request”. Push to another branch and open a pull request in Luzbase.
- You can create a branch by pushing it. Only the owner can delete branches over Git, never the default branch, and not while the branch has unsaved changes.
- You can create tags, but not move or delete them.
- One push can be up to 500 MB.
- A push creates at most 100 versions. Older commits in the same push are collapsed into one version called “N earlier Git commits”. Git keeps every commit either way.
Files you push that Luzbase can’t edit, such as a README.md or a .github/ folder, are kept as Git-only files.
Unsaved changes
Section titled “Unsaved changes”Git sees saved versions only. When co-authors are editing in Luzbase right now, their latest edits may not be in a version yet.
To help with that, Save unsaved changes on fetch under Settings → Git is on by default. When someone who can push to the project runs git fetch or git pull, Luzbase first saves the branch’s unsaved edits as a version called “Auto-saved for Git”, so Git sees them. This happens at most once every five minutes per branch. The owner can turn it off.
A fetch with a read-only token, a deploy token, or on a project whose owner doesn’t have Pro never saves anything. It returns the last saved version.
Sign in with your browser instead of a token
Section titled “Sign in with your browser instead of a token”If you use Git Credential Manager, you can sign in through your browser instead of copying a token.
- Open Account settings → Git and expand Sign in with your browser instead.
- Follow Install Git Credential Manager for your system.
- Run the commands under Tell Git to use it for Luzbase once on that computer.
- Clone a project. Your browser opens on Authorize Git on this computer. Check the account and click Allow.
On a computer without a browser, Git shows a code instead. Enter it at the address Git prints, then click Continue. A sign-in request lasts 10 minutes.
Computers that signed in this way are listed under Signed-in devices. Click Revoke to sign one out.
Choose the email on your commits
Section titled “Choose the email on your commits”By default your commits use a private address ending in @users.noreply.luzbase.com. To use your account email instead, turn on Use my account email in Git commits under Account settings → Git → Commit email. Anyone who can read the repository can then see that address. Your email must be verified first, and the setting applies to versions exported from then on.
Deploy tokens for CI
Section titled “Deploy tokens for CI”A deploy token gives read-only Git access to one project, for example so GitHub Actions can build your PDF on every change. Only the project owner can create one, and it needs Pro.
- On Settings → Git, under Deploy tokens, click New deploy token.
- Enter a name, choose when it expires (30 days, 90 days, 1 year or Never), and click Create token.
- Copy the token. Save it as a repository secret named
LUZBASE_DEPLOY_TOKEN.
Luzbase shows a GitHub Actions step with your project’s clone URL filled in:
- name: Check out the Luzbase project run: git clone "https://deploy:${{ secrets.LUZBASE_DEPLOY_TOKEN }}@git.luzbase.com/<project-id>.git" paperElsewhere, sign in with the username deploy and the token as the password. A deploy token can clone and fetch only that project. It can never push.