Sync Obsidian Across Every Device for Free with GitHub
My notes stay in sync between my PC and iPhone with no subscription, just a private GitHub repo, Git, and one Obsidian plugin.
The idea
An Obsidian vault is just a folder of Markdown files, and Git is very good at syncing folders. Put the vault in a private GitHub repo and every device can pull and push the same notes. As a bonus, you get a full version history of every note.
What you need
- Obsidian on your PC and iPhone, plus the community plugin Obsidian Git.
- GitHub: a free private repository for the vault and a personal access token.
- Git on your PC, and iSH on your iPhone, a free app that gives you a small Linux shell with Git.
How I set it up
1. Create the repo
Create a new private repository on GitHub. Keep it private, since it will hold your personal notes.
2. Set up the PC
Clone the repo to your computer and open that folder in Obsidian as a vault. If you already have notes, move them into the folder, then commit and push them.
3. Clone it on the iPhone with iSH
Install iSH from the App Store, install Git inside it with apk add git, and clone the repo with git clone. When asked for a password, use your GitHub token, not your account password.
4. Move it into Obsidian's folder
Obsidian on iOS only sees vaults inside its own folder, and that folder doesn't exist until you create a vault. So:
- Create a throwaway test vault in Obsidian. This creates On My iPhone › Obsidian in the Files app.
- In the Files app, open the iSH location, find the cloned repo folder, and copy it into On My iPhone › Obsidian, next to the test vault.
- Reopen Obsidian. The repo now appears as a vault. Open it and delete the test vault.
5. Connect the Git plugin
Install Obsidian Git from Community plugins on both devices. On the iPhone, enter your GitHub username and token in the plugin's settings. The PC uses your computer's existing Git login.
6. Voilà
Write anywhere, run Commit and sync, and your notes appear everywhere. I also turn on automatic pull at startup and a periodic auto-sync, so it mostly runs on its own.
Tips
- Scope the token. Use a fine-grained GitHub token that can only read and write this one repository.
- Pull before you write. Syncing when you switch devices avoids most merge conflicts.
- Ignore workspace files. Obsidian rewrites
.obsidian/workspace*.jsonconstantly. Adding them to.gitignoreprevents pointless conflicts between devices.
The verdict
Free, private, and versioned: my notes follow me across devices, and I own every file. Setup takes about 20 minutes, and after that sync is a single tap.