Skip to content

Sharing

Sync

TreeWrite syncs a folder of your documents with a repository of yours on GitHub or GitLab, so your computers and your phone have the same notes. Every document in the folder syncs, open or not, with its assets and the reviews of its flashcards.

TreeWrite has a git client of its own, so you need neither Git nor SSH keys. Your documents go straight from your device to your repository, never through a server of ours.

In Settings › Sync, connect your GitHub or GitLab account, then sync a folder with a repository, a branch, and the whole repository or a folder of it.

  • On GitHub, TreeWrite reaches only the repositories you give the TreeWrite app.
  • On gitlab.com, TreeWrite asks for the read_api and write_repository scopes, which reach every project of your account.
  • For GitLab at another address, as the one of your company, use an access token with the read_api and write_repository scopes.
  • The sign ins stay on your device, encrypted by your system. On Linux, that needs a keyring, as GNOME Keyring or KWallet. Without one, they are kept unencrypted, and Settings › Sync warns you about it.

The first sync puts together the documents of the folder and of the repository, so both can already have some. A synced folder cannot be inside another one, and a device syncs the same folder of a branch only once.

Commits are made with the name and email of your account, and the message TreeWrite sync from {{hostname}} at {{date}}. You can change both, and the message can use {{date}}, {{hostname}}, {{numFiles}} and {{files}}.

Inside the folder, at any depth: every .jsonl document, and its assets and review log in ./treewrite/{filename.jsonl}/, plus the .gitattributes at its root, see In a repository. Nothing else of the folder or of the repository is touched, and the site Publish builds stays on your computer.

A folder syncs when TreeWrite opens, 30 seconds after your last edit in it (10 on a phone), every 5 minutes while TreeWrite is open, when you close it, and when you click Sync now. Nothing syncs while TreeWrite is closed. Each sync that sends something is one commit.

A folder pauses when something needs you: connect the account again when GitHub or GitLab refuses its sign in, or fix a repository, branch or folder that is gone. When GitHub or GitLab limits requests, it waits and syncs again on its own. Nothing is lost while it is paused.

TreeWrite merges documents bullet by bullet, so you can edit the same document on two devices.

  • A bullet changed on both devices keeps the version of the one that syncs last, which tells you so.
  • An edit wins over a removal, so a document deleted on one device and edited on another comes back.
  • A document renamed or moved on one device is renamed on the others, with its assets and reviews.
  • Two different assets with the same name are both kept, one with a number in its name.
  • The reviews of flashcards are merged line by line, so no grade is lost.

On a computer, a file a sync removes goes to the trash of your system.

Settings › Sync lists the files of a folder that cannot sync:

  • files larger than 100 MB, or documents larger than 16 MB on a phone;
  • files whose names differ only in case, as Notes.jsonl and notes.jsonl, of which only the one that was synced already syncs, or else the first in alphabetical order;
  • .jsonl files of other programs;
  • files in a folder that is a link to another one.

Disconnect stops syncing a folder, and keeps its files and the repository as they are. On a new computer, connect the account and the same repository with an empty folder, and the first sync brings every document.

On a computer, sync pauses when Pro ends, and goes on from where it stood when you subscribe again. Your documents, accounts and synced folders stay as they are. See Free and Pro.