Git sync with Overleaf, GitHub and GitLab

Import a repository or connect a project, sync when you press Sync, and choose what to keep where both sides changed the same lines. Accounts, GitHub sign-in and tokens.

Applies to iPhone · iPad · Android · Windows · Mac · Linux Pro Version 3.0.0 or later

A project can be a Git repository on Overleaf, GitHub, GitLab or another host. The app pulls and pushes only when you press Sync, and your files travel only between your device and the host: they do not go through Rectoly's servers. Git sync is a Pro feature (the trial counts).

Add an account

Open Settings › Git and press Add Account. Choose the Host — GitHub, GitLab, Overleaf or Other Host (with its Server) — then sign in:

  • GitHub: press Sign In with GitHub. The app shows a code: press Open GitHub's Page, enter the code there and allow access ("Waiting for the code on GitHub…" turns into the account). This gives the app access to your repositories. To allow only some, choose Or Use a Token and make a fine-grained token with Read and write for Contents on those repositories.
  • GitLab: create a token with read_repository and write_repository (Create a Token opens the page), and paste it.
  • Overleaf: create a token under Git integration in Overleaf's Account Settings (it expires after a year), and paste it. Overleaf's Git works only when the project's owner has a paid Overleaf plan.
  • Other Host: the server, your User Name and a token or password for HTTPS.

Name for Commits and Email for Commits are written into the shared history. Left empty, commits are made under the name "Rectoly for LaTeX".

Tokens stay on this device, in its secure storage (the keychain on iPhone and iPad, the Android Keystore, the system's key store on a computer), and are used only with the Git host.

Import a repository

  1. In the library, open Import from Git:
    • iPhone · iPadAdd › Import from Git.
    • Android · Windows · Mac · LinuxImport from Git above the library.
  2. Paste the repository's URL (https only). For Overleaf, the project's address in the browser works too.
  3. Choose the Account, give the Project Name and press Import.

The app clones the repository into a new project. If it holds a .rectoly-latex.json from someone else, only its main file and compiler are taken.

Connect a project you already have

Open the project and press Sync — on iPhone and iPad it is under Tools until the project is connected. Paste the URL of an empty repository (or of one to merge with), choose the account and press Connect to Git. The first sync pushes the project.

Sync

Press Sync at the top of the project. The sheet lists the Changed Files and a Commit Message you can edit (written in English, such as "Update main.tex"). Press Sync: the app pulls, commits your changes, merges and pushes, then says "Synced. Files received: 2, files sent: 1".

  • Only the current branch is synced, to the branch of the same name.
  • The first time, Add to .gitignore (on by default) keeps this device's own settings and notes (.rectoly-latex.json and .rectoly-latex/) out of Git.
  • If someone pushed in the meantime, the app pulls again and retries by itself.

When both sides changed the same lines

The conflicts screen shows each place both sides changed, This Device beside Other Side. For each, choose one, Both, or edit the text below, then press Use These and Continue. For a picture or another file that is not text, choose which side to keep (a deleted file shows as Deleted).

Cancelling stops the sync: "Sync stopped. Your changes are still on this device." Nothing is lost.

What is not synced

  • SSH addresses, Git LFS, submodules and symbolic links (left as they are), other branches, forced pushes, and syncing in the background.
  • A linked collection's .bib is always taken from this device.
  • A repository in the middle of a merge or rebase started by another Git tool is not synced.

Co-editing and Git

In a co-edited project, only one device syncs with Git (This Device Syncs with Git); the others' changes reach Git through it. Elsewhere the sheet says "… 's device syncs with Git."

If it does not work

  • "The token was refused": check the account's token (Overleaf's expire after a year).
  • "Repository not found": check the URL and that the account can see it.
  • "Couldn't push": check that the token may write to the repository.
  • See also Troubleshooting.

Updated November 27, 2026