xiachong64 downloadsSync your Obsidian vault with a GitHub repository. Commits local changes, pulls remote updates, and pushes automatically.
Sync your Obsidian vault with a GitHub repository. Your vault is the Git working tree — no export, no conversion, no intermediate format.
Once configured, the plugin commits your local changes, pulls remote updates, merges them, and pushes back to GitHub on a timer or on demand.
.gitignore that keeps secrets and noise out of your repository.| Requirement | Notes |
|---|---|
| Obsidian 1.11.4 or later | Desktop only. The plugin uses Node.js APIs, so it cannot run on mobile. |
| Git 2.28 or later | Located automatically, or set a path manually in the settings. |
| A GitHub repository | Private or public. |
| A GitHub account | See Disclosures. |
The Obsidian developer policies require the following to be stated clearly.
git executable against the remote repository you configure. It talks to that one remote (normally github.com) and to nothing else. The plugin itself contains no HTTP client and contacts no other server. No telemetry of any kind is collected or transmitted.secretStorage API when available..git directory. It also probes common installation paths to locate the git executable, and launches that executable as a child process. It does not read or write files outside your vault, other than locating git.main.js, manifest.json, and styles.css from the latest release.<your-vault>/.obsidian/plugins/github-vault-sync-desktop/.git clone <this-repo>
cd <this-repo>
pnpm install
pnpm run build
Then copy main.js, manifest.json, and styles.css into your vault's plugin folder.
github-vault-sync idThe plugin was renamed from github-vault-sync to github-vault-sync-desktop because that id was
already taken in the community registry. Obsidian keys a plugin's settings by its id, so an existing
install does not carry over automatically:
.obsidian/plugins/github-vault-sync/ to .obsidian/plugins/github-vault-sync-desktop/.main.js, manifest.json, and styles.css into that folder (replacing the old ones).Your data.json (repository URL, branch, schedule) comes along with the folder. The access token, if
you stored one, uses a new secret key — enter it once more when prompted.
https://github.com/you/your-vault.git.Contents: Read and write. Stored via Obsidian's secretStorage when available..gitignore and .gitattributes, registers the merge driver, and makes the first commit and push.| Action | How |
|---|---|
| Sync now | Click the status bar item, or run GitHub Vault Sync (Desktop): Sync now |
| Automatic | Every 300 seconds by default. Configurable, or turn it off. |
| View log | GitHub Vault Sync (Desktop): View sync log (credentials are redacted) |
| Display | Meaning |
|---|---|
✓ 已同步 |
Local and remote are in sync |
⇅ 同步中… |
A sync is running |
↑2 |
Two local commits are not pushed yet |
☁ 离线 |
Fetch failed. Local commits are kept; the next run retries. |
⚠ 冲突 2 |
Two files need manual conflict resolution |
⚠ 待解决 |
A previous conflict is unresolved; syncing is paused |
✗ 失败 |
The last run failed |
When both sides change the same line of the same note, Git cannot merge automatically. The plugin then:
note.conflict-<device>-<timestamp>.md — so nothing is lost even if you delete the markers by accident.⚠ 冲突.Resolve it by editing the note into the version you want, removing the <<<<<<<, |||||||, =======, and >>>>>>> lines, then syncing again.
Before every merge the plugin records the pre-merge state as a conflict/<timestamp> branch ref, so a merge that goes wrong can be undone with git reset --hard conflict/<timestamp>.
| Path | Why |
|---|---|
.obsidian/plugins/ |
Plugin data.json files hold plaintext tokens and private keys; bundled main.js files are multi-megabyte build artifacts |
.obsidian/workspace.json |
Changes on every pane switch — pure noise |
.obsidian/graph.json |
Same |
.trash/ |
Obsidian's trash |
*.conflict-* |
Conflict copies, so they cannot cause further conflicts |
Other configuration files such as appearance.json, hotkeys.json, and community-plugins.json are synced, so your setup stays consistent across devices.
The status bar shows ☁ 离线
Check, in order: the repository URL ends with .git; the credential helper is configured or the token is valid and unexpired; a fine-grained token has Contents: Read and write. Open the sync log for the specific reason — credentials are redacted.
"Git executable not found"
Use the Detect button in the settings. The plugin searches PATH first, then common installation locations, including the Git bundled with GitHub Desktop. If that fails, enter the full path manually.
Sync is slow on a large vault
The initial push of a large vault can take a while. Later syncs only transfer changes.
pnpm install
pnpm run typecheck # tsc --noEmit
pnpm test # 46 core tests + 26 plugin tests
pnpm run build # produces main.js
The Git logic lives in src/core/ and deliberately does not import obsidian. That keeps it testable in plain Node against real Git repositories, which is how the test suite exercises the full commit / merge / conflict / push path without launching Obsidian.
MIT — see LICENSE.
GitHub Vault Sync (Desktop) 把 Obsidian 仓库与 GitHub 仓库统一成同一个东西:Vault 根目录就是 Git 工作区根目录,一次同步 = 一次 commit + fetch + merge + push,不需要任何导出或转换。
详细的中文使用说明见仓库文档目录。