Skip to content

fleet-repo-sync

Git-native repo-set reconciler that keeps ~/source/repos consistent across the fleet's Windows PCs — so no machine is ever missing a repo you're working on.

It never file-syncs a live working tree (Syncthing/Dropbox/OneDrive over .git races index.lock, fights .claude/worktrees/*, and can propagate one PC's uncommitted mutation onto another). Only two writes exist in the whole tool:

  1. a fresh git clone for a missing repo, and
  2. git merge --ff-only for a clean tracking branch that is strictly behind.

Everything ambiguous SKIPs LOUD. Uncommitted work cannot be lost — the dirty gate (git status --porcelain, main tree only) short-circuits before any mutation.

Usage

# read-only audit (no clone, no ff) — safe anywhere
powershell -File fleet-repo-sync.ps1 -Mode report

# reconcile: clone-if-missing + fetch + ff-only-when-clean
powershell -File fleet-repo-sync.ps1 -Mode reconcile

Fan out across the fleet via fleet-dispatch, or run per-PC on a 30-min scheduled task.

Decision tree (per repo, per PC)

missing        -> clone (origin, else peer seed, else report MISSING_UNCLONEABLE)
dir w/o .git   -> PATH_CONFLICT (never delete to "fix")
mid-op         -> SKIP_MIDOP     (merge/rebase/cherry-pick/bisect in progress)
dirty          -> SKIP_DIRTY     (P0: uncommitted/untracked on main tree)
detached HEAD  -> SKIP_DETACHED
no upstream    -> SKIP_NO_UPSTREAM
ahead only     -> SKIP_AHEAD     (never auto-push)
ahead + behind -> SKIP_DIVERGED
behind + clean -> merge --ff-only -> FAST_FORWARDED
even           -> CURRENT

Never: auto-commit, push, --force, reset, clean, stash, or touch .claude/worktrees / bin / obj.

Manifest

manifest.json is the canonical repo set (checked-in source of truth — not org-scrape, not mesh-union). Regenerate the canonical set from the fullest host with gen-manifest.ps1.

Designed by fleet LLM council (2026-07-18, opus tier). Slice 0 = these PowerShell scripts; durable slice = C# console tool + JSON report schema + Mission Control drift matrix.