sync-git

Synchronize uncommitted work and branch state across git repositories and worktrees with approval gates.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/sergeiwallace/skills --skill sync-git-sergeiwallace
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync-git
Source: https://github.com/sergeiwallace/skills/tree/main/skills/sync-git
Command: npx skills add https://github.com/sergeiwallace/skills --skill sync-git-sergeiwallace

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires typer, pydantic-settings, skill-cli-foundation, psutil, and includes scripts (resource) components.

What problem does it solve? Keeping multiple git repositories and linked worktrees in sync is error-prone: uncommitted changes get lost, stale feature branches become integration bases, and careless deletions or force-pushes destroy remote content. This Skill automates safe synchronization while requiring explicit human approval for deletions, discards, and gitignore changes. ## Core Features & Use Cases - Safe commit and push pipeline: Byte-vets uncommitted changes, non-force-pushes local commits, and fast-forwards or cleanly merges fetched remote commits after anchor, isolated-index, and readback checks. - Multi-target discovery: Syncs the main worktree and current session worktree by default, or explicit targets via repo:, worktree:, branch:, all-worktrees:, and all-repos: selectors. - Conflict proofing: Uses git merge-tree to prove whether divergent trees already converge, recording Sync-deletion-accepted trailers on integration commits. - Mandatory human gates: Tracked-file deletions require --allow-deletions after approval; discard and .gitignore recommendations always stop for explicit user confirmation. - Use Case: Before ending a work session spread across three worktrees, run the sync command to commit safe changes, reconcile each branch with fetched trunk, and surface any divergent edits or deletions for your review. ## Quick Start Ask the agent to run the sync-git sync command to assess and safely synchronize the current repository and session worktree, reviewing any deletion or conflict checkpoints it raises.

Frequently Asked Questions about sync-git

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync uncommitted changes across multiple git worktrees?

Run the sync command with no arguments to sync the main worktree and current session worktree, or pass explicit targets like worktree:/path, all-worktrees:/repo, or all-repos:/directory. Safe changes are committed and pushed automatically after byte-vetting checks.

How do I test git synchronization without making changes?

Use the --dry-run flag with the sync command to preview all actions without committing, pushing, or merging anything. The report shows each target's state and reason so you can review before executing.

Can the skill delete tracked files or force-push branches?

Tracked-file deletions are blocked by default and require the --allow-deletions flag after explicit human approval. Force-push is limited to an exact force-with-lease for reconciling an obsolete worktree receive ref after a merge-tree proof.

What happens when git merge conflicts are detected during sync?

The skill runs git merge-tree to prove whether final trees already converge or losses are non-merge deletions committed on fetched trunk. Same-path divergent edits, renames, and unproved deletions remain human checkpoints and are not auto-resolved.

Why does sync refuse to commit files containing secrets?

New or modified sensitive-pattern paths and newly introduced secret-shaped bytes are always refused by the byte-vetting gate. An unchanged, already-committed safe template like .env.example does not trigger the veto.