Git Vault Sync

by alexandervasin
5
4
3
2
1
New Plugin

Description

This plugin has not been manually reviewed by Obsidian staff. One-click Git sync with interactive conflict resolution and selective commits. HTTPS personal-access-token auth, English and Russian UI; runs on desktop and mobile.

Reviews

No reviews yet.

Stats

stars
downloads
0
forks
0
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

Github

Git Vault Sync

One-click Git sync for Obsidian, with interactive conflict resolution, on desktop and mobile. Push and pull your whole vault to a Git remote (GitHub via HTTPS token) with a single button — and pick exactly what goes into each commit.

Git Vault Sync is a pure-JavaScript plugin, so it needs no system git and works on Android/iOS as well as desktop.

Two sync engines

There's a Sync engine setting (Auto / Git / GitHub API); Auto picks the right one per platform:

  • Desktop → Git engine (isomorphic-git): full local history and true two-parent merges.
  • Mobile → GitHub API engine (Git Data API): transfers files one blob at a time instead of a whole packfile, so it syncs large repos on a phone without running out of memory. Selective sync / commit preview are git-engine only.

Both push and pull to the same GitHub remote, so all your devices stay in sync.

Features

  • One-click sync — stage all changes → commit → fetch → merge → push.
  • Conflict resolution UI — when a merge conflicts, a dialog lists each file and lets you keep the local version, the remote version, or edit the merged result by hand.
  • Commit preview / selective sync — review every change before syncing and uncheck files you don't want to commit yet. Deselected edits stay safely on disk and out of the commit, even across a merge.
  • Status-bar indicator — shows pending change count, a spinner while syncing, ✓ when clean, and the last-sync time on hover. Click it for a menu.
  • Auto-sync — optional sync on startup and/or on a timer.
  • Excluded paths — glob patterns (e.g. .obsidian/workspace.json) that are never committed or counted.
  • Saved credentials — remote, branch, and token are stored once.

Requirements

  • A Git repository on GitHub (or any HTTPS Git host).
  • A Personal Access Token (PAT). For a fine-grained token, grant the repo Contents: Read and write.

Installation

Git Vault Sync is not yet in the community plugin store. There are two ways to install it today.

BRAT installs plugins straight from a GitHub repo and keeps them updated. Works on desktop and mobile.

  1. Install BRAT from the community plugin store and enable it.
  2. Run BRAT: Add a beta plugin for testing and paste this repo's URL.
  3. BRAT downloads the latest release and enables Git Vault Sync.

Manual

  1. Download main.js, manifest.json, and styles.css from the latest release (or build them — see Building from source).
  2. Copy the three files into <your-vault>/.obsidian/plugins/git-vault-sync/. On mobile, copy them into the same folder inside the vault (see TESTING.md for per-platform tips).
  3. In Obsidian: Settings → Community plugins, enable Git Vault Sync.

Configuration

Open Settings → Git Vault Sync and fill in:

Setting Description
Remote URL HTTPS clone URL, e.g. https://github.com/user/vault.git
Branch Branch to sync (default main)
Username Your GitHub username
Personal Access Token Stored in plaintext in this plugin's data.json
Author name / email Written into commits
Commit message Template; {{date}} is replaced with a timestamp

Run Git Vault Sync: Test connection to remote from the command palette to verify the URL and token.

⚠️ Security: the token is stored in plaintext in .obsidian/plugins/git-vault-sync/data.json. If your vault itself is a Git repo, make sure that file is .gitignored so the token is never committed.

Usage

  • Sync — click the circular-arrows ribbon icon, the status bar (→ Sync now), or run Sync vault with Git.
  • Review & sync — click the checklist ribbon icon (or Review changes & sync) to open the commit preview, uncheck files, then Sync selected.
  • Resolve conflicts — if a merge conflicts, the resolution dialog opens automatically. Choose per file: Use local, Use remote, or Edit manually, then Resolve & sync. Cancel aborts the merge cleanly.
  • Initialize / link a repo — on a fresh vault, Settings → Git Vault Sync → Initialize runs git init, links the remote, fetches, and checks out the remote branch.

Building from source

npm install
npm run dev     # watch + rebuild
npm run build   # type-check + production bundle → main.js

For development, symlink the project into a test vault so rebuilds are picked up:

ln -s "$(pwd)" /path/to/Vault/.obsidian/plugins/git-vault-sync

Architecture

See CLAUDE.md for the module map, sync flow, and implementation notes (the isomorphic-git filesystem/HTTP adapters, conflict handling, and the non-obvious gotchas).

Security

  • Your Personal Access Token is stored in plaintext in this plugin's .obsidian/plugins/git-vault-sync/data.json. Obsidian has no secure secret storage available to plugins, so the token sits on disk unencrypted, like other Git plugins for Obsidian.
  • The token is sent only to your configured Git remote over HTTPS (as a Basic auth header), never to any third party. It is not logged and not written into commits.
  • If your vault itself is tracked by Git, make sure .obsidian/plugins/git-vault-sync/data.json (or the whole plugin folder) is in your vault's .gitignore, or your token will be pushed to the remote.
  • Use a fine-grained token scoped to the single repo with Contents: Read and write, so a leak has the smallest possible blast radius.

License

MIT — see LICENSE.