Folder-sync services keep the newest copy of a note and hope for the best. Git keeps every version you commit, tells you exactly when two devices changed the same note, and works with any host. For notes you'd hate to lose, that's a good trade — provided something does the committing for you.
Set it up
From the folder that holds your notes (a vault, a workspace, or a plain directory):
git init
git add .
git commit -m "Notes: initial import"
Then create a private repository on any Git host, add it as a remote, and push:
git remote add origin git@example.com:you/notes.git
git push -u origin main
On every other machine, clone the repository and open the folder in your
editor. From then on the loop is commit, push, pull.
What to ignore
A .gitignore at the root keeps machine-specific noise out of history:
.DS_Store
Thumbs.db
*.tmp
If your app stores indexes or caches inside the notes folder, ignore those too — they're regenerated and differ between machines. One exception worth committing: settings you want identical everywhere, like themes or templates.
Attachments deserve a decision, not a default. Git is built for text; images and audio bloat the repository permanently, since history keeps every version of every binary. If your notes are text-heavy, commit everything. If you keep large attachments, consider storing them outside the repository, or a host with generous limits.
The sync loop, without the misery
The failure mode of Git-for-notes is the same as Git-for-code: two devices change the same note, and the second push is rejected. The fix is habit — pull before you write, commit and push when you stop — or automation:
- A cron job or launchd timer that commits and pushes any changes every hour or every day. Conflicts still surface, but nothing is lost.
- An app with Git built in. Octarine's Git Sync does the add, commit, push, and pull from inside the app on a schedule you set, with the diff visible before you commit; its docs cover the details. In Obsidian, the same job is done by community plugins.
When a conflict does happen, Git shows both versions of the note in the file
with conflict markers (<<<<<<<), and you keep what you want before
committing. That's the whole advantage over folder sync: the conflict is loud
instead of silent.
Phones
Git clients exist for iOS and Android, but the commit-push-pull loop is clumsy on a phone. If you capture on mobile and write on desktop, a common setup is a folder-sync service for the phone's changes and Git on the desktop for everything else — the two compose, because both operate on plain files.
When not to use Git for notes
- You never edit the same note from two places and don't care about history: a folder service is simpler.
- Your notes live in an app's database rather than as files: Git can only version what it can see.
- Your repository would hold gigabytes of attachments: consider a different home for those.
Sources and review notes
- Git behavior (history, conflict markers, ignoring files) is documented in the Git book.
- Octarine's built-in Git Sync is described in its documentation; our Octarine vs Obsidian page covers how Obsidian reaches the same result through community plugins.
