Repository navigation
GitHub Backups and Co Writing
Anabasis can back up your projects to a private GitHub repository. Every backup is kept, so you can go back to any of them. The same repository lets you pick up on another device, or pass drafts back and forth with a co-author. You take turns rather than typing at the same moment, and Anabasis merges each other’s changes, word by word.
Nothing here goes through a server of ours. Anabasis talks to GitHub directly from your browser, using a token you make.
- A GitHub account. A free one is enough.
-
A private repository for your backups, for example
anabasis-backups. Keep it private: anyone who can read a repository can read the projects in it, unless a project is locked. -
A fine-grained personal access token, made on GitHub under Settings → Developer settings → Fine-grained tokens:
- Repository access: Only select repositories, with just the backup repository.
- Permissions: Contents: Read and write, and nothing else.
- Expiration: a date, not “No expiration”. 90 days is sensible. When it expires, make a new token and paste it in.
If a token like this ever leaks, it reaches only those backups, and only until it expires. Anabasis warns you if you paste a classic token (ghp_…), which can reach every repository you have.
- Open Back up to GitHub… from the Export menu.
- Enter the repository as
owner/name. Leave Branch (main) and Folder (anabasis) as they are unless you have a reason to change them. - Paste the token, then choose Test connection.
- Tick Back up whenever I save if you’d like backups to happen on their own, then choose Back up now.
Without Remember, the token is kept only until you close the tab. With Remember ticked, Anabasis asks you to choose a password for the token, then stores the token in your browser encrypted with that password. It’s never stored as plain text.
- Anabasis asks for the password once a session, the first time you back up or open something from GitHub. After that, backups run quietly.
- It never asks while you’re writing. If an automatic backup comes due while the token is locked, a notice says backups are paused, with an Unlock button.
- The dialog shows only the token’s last four characters (
github_pat_…7f3a). Show and Copy ask for the password every time, so someone at your unlocked computer can’t take the token. - When a locked project hides itself after being idle, the token locks too.
- Forgot the password? Nothing is lost, because your backups are on GitHub. Choose Forgot it? Forget the token, make a new token on GitHub, paste it in and choose a new password.
A token remembered by Anabasis 3.0 (stored as plain text) still works. A notice offers to protect it with a password, and the plain-text copy is deleted once you do.
Each project gets a folder of its own:
anabasis/
README.md what this repository is
The-March-Up-Country-a1b2c3/
README.md the title, and a link to each chapter with its word count
project.json the project itself
pictures/ each picture once, under its fingerprint
merge/ the merge record, one file per chapter
chapters/
01 Book One.md a readable copy of each chapter
02 Book Two.md
- Each picture is uploaded once. After that, a backup sends only what changed, so a book with forty pictures backs up about as fast as one with none.
-
Chapters are readable on GitHub. GitHub shows each chapter copy as a formatted page. Open one and choose History to see what changed in it at each backup. These copies are only for reading: Anabasis works from
project.json, so editing a chapter file on GitHub doesn’t change your project. - Commit messages say what changed. The first line is a summary (“12,480 words, 9 documents, 31 notes”). Below it comes a line for each chapter that changed, for example “Book Two: +412 words”.
Backups made by Anabasis 3.0 (a single .json file per project) still list, open and show in History. Your first 3.1 backup moves the project into its folder.
On the other device, enter the same repository and token, then choose Open a project… in the GitHub dialog (or From GitHub… on Project home). Pick the project, and it opens with its pictures and its merge record.
Whenever you come back to Anabasis, it checks GitHub for a newer backup of the open project. If it finds one, a notice says when it was made and by whom.
This is the old-fashioned way of writing together: one person works, backs up, and the other picks it up. What Anabasis adds is that you don’t have to take strict turns. If you both worked on the project since the last backup, your changes are merged:
- Get latest (in the GitHub dialog) brings the newest backup’s changes into your copy.
- Back up now does the same first when GitHub has something newer than you’ve seen, then backs up both together, and tells you what was merged.
- Merge it in, on the notice, does it when an automatic backup finds GitHub ahead. Automatic backups never change the text while you’re writing.
The merge works like Merge another copy of this project:
- Changes to different paragraphs simply combine.
- A paragraph you both changed keeps both versions, outlined in the text for you to read over.
- A paragraph one of you deleted while the other edited it comes back, outlined, so nothing is lost.
- Notes and sources from the other copy come in too.
- A safety copy of each merged chapter goes into its Drafts before anything changes.
History lists each backup with who made it, and any one can be opened. If two backups land at the same moment, Anabasis tries again on top of the other one, merging first, so both are kept.
Each of you needs your own GitHub account and your own token. The simplest way to share one repository safely is a free GitHub organization that owns the backup repository:
- On GitHub, choose + → New organization and pick the free plan. Name it for the project or for your group.
- Create the private backup repository inside the organization.
- Invite your co-author to the organization as a member, and give them write access to the backup repository.
- Each of you makes a fine-grained token with the organization as the resource owner, limited to that one repository, with Contents: Read and write.
Why an organization rather than inviting someone to a repository on your own account? GitHub’s fine-grained tokens can’t yet be used on a repository where you’re only a collaborator. Your co-author would have to make a classic token instead, which can reach every repository they have. With an organization, each token reaches only the backups. You can remove someone from the organization without touching your own access, and anyone’s token can be revoked on its own.
If the organization requires approval for fine-grained tokens, an owner approves each new token once. An owner’s own tokens are approved automatically.
A locked project is backed up locked:
-
project.json, every picture and the merge record are encrypted with the project’s key. - Picture names come from a keyed hash, so they give nothing away.
- There are no chapter copies, and the project’s README says only that it’s locked.
- Commit messages say “locked project”, without its title.
- A project locked before its first backup goes into a folder named
Locked-project-…rather than its title.
Another device opens a locked backup with the project’s password, recovery key or passkey, and locked copies merge just like unlocked ones.
- GitHub keeps history. Locking a project, or removing a picture or a chapter, changes what’s in the folder from then on. Earlier backups still hold what they held, which is how History can reopen them whole. If something must be gone for good, start a new repository and back up there.
- It’s turn-taking, not live. You see each other’s work when one of you backs up and the other gets the latest, not as you type.
- Backups from 3.0 can’t be merged. They have no merge record, so for those Anabasis offers to open the newer backup, or to back up yours on top. Nothing is lost either way.
- Public repositories: Anabasis won’t back up to one without asking, and automatic backups never do.
- Work offline (Settings) stops all of this until you turn it off.
- “GitHub didn’t accept the token.” It may have expired. Make a new one and paste it in.
- “The token can’t write to that repository.” Give it Contents: Read and write for that repository.
- “A picture in this backup doesn’t match its fingerprint.” Someone changed or damaged a picture on GitHub. Open an earlier backup from History.
- “A merge record in this backup is damaged.” Open the backup instead (History), or back up from your copy to start a fresh record.
- Backups paused? Choose Unlock on the notice and enter the token’s password.
Anabasis is published by Zero History under the AGPL 3.0. These pages live in docs/wiki/ in the main repository; corrections are welcome as pull requests.
Start here
- Getting started
- Projects, saving and privacy
- GitHub backups and co-writing
- Your desk: themes, workspaces, tasks and sketches
Writing with sources
- Citations and styles
- Sources
- Notes and the board
- Planning and structure
- Charts, maps and data
- Reading PDFs and ePubs
- Archive photos
- Languages and translation
Thinking it through
Finishing
Elsewhere