/ 2026.01.27 /
maniac /
Obsidian × Git
context
Obsidianで管理しているドキュメントに対して気付かぬうちに誤ペースト(cmd + a > cmd + v)をしてしまい、そのまま上書きされた結果、大事なドキュメントがゴミと化す事件が何度かあった。誤ペーストを防ぐことは出来なさそうので、バージョン管理を導入して自分の尻拭いをすることにした。
specification
- リモートリポジトリは不採用
- マルチデバイス間の同期はicloud上にvaultを配置することで一旦実現しているので
- ObsidianプラグインのObsidian Git3を導入
Split automatic commit and pushは有効にしてpush系はfalseにAuto commit intervalは60に- あとは基本初期値のまま
- .gitignoreには公式推奨1のものをそのまま追加
# to exclude Obsidian's settings (including plugin and hotkey configurations)
.obsidian/
# to only exclude plugin configuration. Might be useful to prevent some plugin from exposing sensitive data
.obsidian/plugins
# OR only to exclude workspace cache
.obsidian/workspace.json
# to exclude workspace cache specific to mobile devices
.obsidian/workspace-mobile.json
# Add below lines to exclude OS settings and caches
.trash/
.DS_Store
note
- これで安心して誤ペーストできるようになった
- シェルで
./_debris build --sass --live --optimize-images回しながらLazygit2でObsidianのbackup状況を眺めるのが楽しい
