Any Git Sync

An Obsidian plug-in that syncs your notes through any git server, including your own. On desktop and mobile, without installing git.

Smart Live
  • Version 0.5.2
  • Desktop and mobile
  • MIT licence

Why

Obsidian keeps your notes as ordinary files on your own device. That’s exactly why I use it. To keep them in step across devices, you pick a paid service, a cloud folder or git. I wanted my notes on my own git server, with no cloud service in between. And it had to work on a phone too, where there’s no git.

The Easy Git Sync plug-in by 69Jesse already did a lot well: merging notes smartly and settling conflicts neatly inside the note itself. But it only worked with GitHub. Any Git Sync is a fork of it.

What I added

  • Any git server. Instead of the GitHub API, the plug-in speaks the git protocol itself, over HTTPS. Forgejo, Gitea, GitHub, GitLab, Codeberg or a server of your own: it works everywhere. Every downloaded object is verified.
  • History. A panel with the status, the commits from all your devices and, per file, what changed.
  • Everything can be undone. Undo one sync, restore one file or roll the whole vault back to an earlier point. You see what changes first, and each step is a new commit, so nothing is ever overwritten.
  • One bad file stops nothing. The rest keeps syncing, and the panel says what went wrong and how to fix it.
  • Safe closing. Close Obsidian on desktop with notes that haven’t synced yet, and the plug-in asks first.
  • File names a device can’t store, as on Android and Windows, get lookalike characters there. The server keeps the real name.

Line-level merging and the conflict view come from the original project.

Privacy and security

The plug-in connects only to the repository you set up yourself. No telemetry, no ads. The access token stays in the device’s keychain and never syncs.

The repository stays an ordinary git repository. You can clone it, edit it in an editor and push, and the vault takes those changes in like any other device’s.

One thing to know: plug-ins in your vault sync along with it. Anyone who can write to your repository can run code on all your devices. Keep the repository private and the token limited to that one repository.

For the technically curious

The plug-in is written in TypeScript and needs no git on the device. It speaks the git protocol itself, reads and verifies packs and hashes, and merges changes with a three-way comparison. The tests run against a real git server. Limits: HTTP or HTTPS only, so it works on a phone, and files over 100 MB are skipped.

Where it stands

Version 0.5.2 runs in my own vault. I built it because I needed it, and like the original it’s under the MIT licence.

← Back: Lab