sync-branches

Fetches origin/main and merges it into all local branches and worktrees across sibling git repositories.

Updated May 3, 2026
One-click install
npx skills add https://github.com/Claudfather/clauDNA --skill sync-branches-claudfather
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync-branches
Source: https://github.com/Claudfather/clauDNA/tree/main/skills/sync-branches
Command: npx skills add https://github.com/Claudfather/clauDNA --skill sync-branches-claudfather

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Keeping every local branch and git worktree up to date with origin/main across a multi-repo workspace is tedious and error-prone when done by hand. This Skill automates the entire sweep in one pass while protecting uncommitted work. ## Core Features & Use Cases - Multi-repo discovery: Scans every sibling directory under the workspace root for its own .git and syncs each repository, not just the current one. - Safe merging: Fetches origin/main, fast-forwards or merges only when the working tree is clean, and aborts on conflicts without forcing anything or touching stashes. - Summary reporting: Produces a table showing each repo, branch, worktree, and status (up to date, merged, skipped, or conflict). - Use Case: Run it on a recurring interval via /loop 2h to keep a dozen feature branches across several repos continuously current with main, surfacing conflicts early instead of at PR time. ## Quick Start Ask the assistant to sync all branches and worktrees across your workspace with origin/main, optionally naming the workspace root directory.

Frequently Asked Questions about sync-branches

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

FAQPage Schema
How do I update all local git branches with origin/main at once?

Run this Skill to fetch origin/main and merge it into every local branch and worktree across all sibling repositories. It skips branches with uncommitted changes and reports a status table when finished.

How to sync git worktrees across multiple repositories?

The Skill discovers every sibling directory containing a .git folder under the workspace root, lists each repo's worktrees with git worktree list, and merges origin/main into each clean worktree.

Does it merge branches that have uncommitted changes?

No. It checks git status --porcelain before merging and skips any branch or worktree with uncommitted changes, reporting it as skipped so no work is lost or stashed unexpectedly.

What happens when a merge conflict occurs during sync?

The merge is aborted immediately with git merge --abort and the branch is reported as needing a manual merge. Nothing is forced, so the repository is left in its pre-merge state.

Can I run branch syncing on a schedule automatically?

Yes, invoke it through /loop with an interval such as /loop 2h to re-run the sync periodically. In loop mode the output is condensed to just the status table unless conflicts occur.