This note preserves the local setup used to sync the vault content through OneDrive while keeping the repository tooling outside the synced folder.

Goal

The goal is to edit the vault from Obsidian and sync the content across devices without placing the whole Git repository inside OneDrive.

Only the vault content is synced. Repository machinery such as .git/, node_modules/, public/, Quartz configuration, package files, and GitHub Actions stays in the normal development repository.

Current Layout

The repository lives here:

C:\dev\insight-vault

The synced vault content lives here:

%USERPROFILE%\OneDrive\onesync\insight-vault

The repository’s content/ path is a Windows junction pointing to that OneDrive-backed folder:

C:\dev\insight-vault\content
  -> %USERPROFILE%\OneDrive\onesync\insight-vault

Quartz reads from content/, Git sees the files under content/, and Obsidian can open the OneDrive-backed vault folder.

Why Use a Junction

A junction keeps two needs separate:

  • Git and Quartz expect the vault content to exist under the repository’s content/ folder.
  • OneDrive and mobile sync tools need the editable Obsidian vault to live inside a synced OneDrive folder.

The junction lets both views point to the same files.

This avoids putting the whole repository in OneDrive, which would unnecessarily sync Git metadata, dependencies, build output, and other generated files.

Recreate The Junction

From the repository root, the junction can be recreated with PowerShell:

New-Item -ItemType Junction `
  -Path "C:\dev\insight-vault\content" `
  -Target "$env:USERPROFILE\OneDrive\onesync\insight-vault"

Before creating the junction, the target folder must already contain the vault content.

Do not delete a populated content/ directory casually. First confirm whether it is a real directory or a junction:

Get-Item "C:\dev\insight-vault\content" | Format-List FullName,LinkType,Target,Attributes

Expected shape:

LinkType   : Junction
Target     : {C:\Users\<user>\OneDrive\onesync\insight-vault}
Attributes : Directory, ReparsePoint

Working Model

The effective model is:

Obsidian edits OneDrive-backed files
        |
        v
OneDrive syncs the vault content
        |
        v
The repository reads the same files through content/
        |
        v
Quartz builds the public site from content/

The junction is not a separate copy. It is another path to the same directory tree.

Mobile Sync Model

On the phone, OneDrive or a OneDrive sync app can sync the same OneDrive folder to a local Android folder, and Obsidian Mobile can open that local folder as a vault.

The phone does not need the Git repository. It only needs the synced Markdown content.

Important Cautions

Set the OneDrive-backed vault folder to stay available offline when possible. If Files On-Demand leaves some files cloud-only, local builds or searches may behave inconsistently until the files are downloaded.

Avoid editing the same note from multiple devices at the same time. Let OneDrive finish syncing before switching devices.

Keep generated folders such as node_modules/, public/, and .quartz/ out of the synced vault folder. They belong to the repository environment, not to the Obsidian vault.

When cloning this repository on another machine, the junction itself may not be recreated automatically. Recreate the content/ junction there only if that machine should use the same OneDrive-backed vault layout.

Verification

Check that the repository sees the content:

git status --short

Check that Quartz can build from the junction-backed content/ folder:

npm run build

Check the junction target:

Get-Item "C:\dev\insight-vault\content" | Format-List LinkType,Target