← ClaudeAtlas

repo-device-synclisted

Multi-device git sync ritual for repos worked on from several machines, sometimes concurrently. Fetches and diffs origin before work starts, reconciles inbound commits from other devices, re-fetches immediately before every push, and verifies branch parity afterward. Divergence is a stop-and-ask condition - never force-push, rebase shared history, or hard reset. Commits default to ONE per session and verify the staged set first, because `git commit` writes the whole index rather than the paths just added. MUST be used for ANY commit, push, or pull intent in such a repo, however casually phrased ("ok push this up", "ship it", "just commit it all") - the ritual is the point, not the git command.
anton-winter-arch/dotagents · ★ 1 · Code & Development · score 72
Install: claude install-skill anton-winter-arch/dotagents
# repo-device-sync Keeps one repo consistent across devices that may commit concurrently. The failure this prevents: starting work on stale state, or pushing over a commit another machine landed mid-session. The discipline is always the same - **fetch before trusting anything, diff before pulling, re-fetch before pushing, verify after.** ## Phase 1 - Assess (always first) ```bash git status --porcelain # uncommitted local work? git fetch origin # never reason about origin without this git status -sb # ahead/behind for current branch git branch -vv # ahead/behind for all tracked branches ``` Report per tracked branch: in sync / ahead N / behind N / diverged (N and M). Surface uncommitted changes before doing anything else - they change what is safe below. ## Phase 2 - Reconcile inbound (behind) 1. Show what is coming: `git log --oneline HEAD..origin/<branch>` and a summarized `git diff HEAD...origin/<branch> --stat`. 2. **Deletion pre-flight - run before every pull.** An incoming commit that untracked newly-ignored paths arrives as a real working-tree deletion, and afterwards those paths are ignored, so the loss leaves no trace anywhere the default views look: ```bash git diff --name-status HEAD origin/<branch> \ | awk '$1=="D"{print $2}' | git check-ignore --stdin ``` Any output means this pull deletes files that will then be invisible. Stop, show the list, and ask before pulling. It is recovera