Post

Sharing an #Obsidian vault across multiple computers with #Git gives you full ownership, revision history, and zero subscription fees. But a default `git init` quickly leads to sync friction and merge conflicts. Here is my step-by-step guide to make it seamless 🧵👇

1️⃣ Stop workspace conflicts in `.gitignore` #Obsidian constantly updates cursor positions, open tabs, and split sizes in `.obsidian/workspace.json`. Ignore `workspace*.json`, `.obsidian/cache/`, and `graph.json` to stop the majority of your daily merge conflicts.

2️⃣ Don't let #Git resurrect deleted notes #Obsidian moves deleted notes to `.trash/`. If Git tracks this folder, deleting a file on your laptop can cause it to reappear when pulling on your desktop. Add `.trash/` and OS noise (`.DS_Store`, `Thumbs.db`) to `.gitignore`.

3️⃣ Fix phantom diffs with `.gitattributes` Switching between macOS and Windows? Git's default line ending conversions can turn an entire untouched note into a phantom diff. Set `* text=auto eol=lf` in `.gitattributes` so every Markdown file is stored cleanly with LF.

4️⃣ Tune obsidian-git plugin settings Two options prevent diverging branches: • `autoPullOnBoot: true` pulls changes immediately when Obsidian opens, before you type. • `pullBeforePush: true` integrates remote commits first. Bonus point: set a hotkey for intentional sync.

5️⃣ Sync your plugins & themes, keep secrets local Track `.obsidian/community-plugins.json` and `.obsidian/plugins/` so a new machine is ready right after `git clone`. Check plugins storing API keys in plain text in `data.json`: keep those ignored or in system keychain.

0 reposts3 likes