worktree-sync

Syncs Git worktrees by fetching remote and rebasing or merging main into feature branches.

18|5|Updated Nov 3, 2025
One-click install
npx skills add https://github.com/mvillmow/ml-odyssey --skill worktree-sync
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-sync
Source: https://github.com/mvillmow/ml-odyssey/tree/main/.claude/skills/worktree-sync
Command: npx skills add https://github.com/mvillmow/ml-odyssey --skill worktree-sync

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? This Skill automates the process of synchronizing Git worktrees with remote and main branch changes, ensuring all your parallel development environments are always up-to-date. It eliminates manual fetching and rebasing, saving time and preventing conflicts.

Core Features & Use Cases:

  • Fetch Latest Changes: Pulls updates from the remote repository, keeping your local branches current.
  • Rebase/Merge Feature Branches: Integrates main branch changes into feature worktrees, minimizing merge conflicts.
  • Use Case: You have multiple feature branches in separate worktrees. Use this skill to quickly fetch the latest changes from the main branch and rebase all your feature worktrees, preventing merge conflicts later and ensuring you're always working on the most current codebase.

Quick Start: Use the worktree-sync skill to sync all your git worktrees with the latest remote changes.

Frequently Asked Questions about worktree-sync

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

FAQPage Schema
How do I keep multiple Git worktrees synchronized with main branch changes?

Synchronizing Git worktrees with main branch changes involves fetching remote updates, then rebasing or merging feature branches against the updated main. This Skill automates that workflow—fetching from origin, pulling main, and rebasing feature branches—so all your parallel development environments stay current without manual commands.

When should I rebase versus merge feature branches during synchronization?

Rebasing rewrites feature branch history on top of main, creating a linear commit history ideal for long-running branches. Merging preserves both histories and is safer when branches are shared. This Skill supports both strategies; choose rebase for cleaner history or merge to preserve parallel development context.

How do I resolve conflicts when rebasing worktrees against the updated main branch?

When rebase encounters conflicts, Git pauses and marks conflicting files. Resolve conflicts manually, stage the fixed files, then run git rebase --continue to resume. This Skill handles the rebase workflow and signals when conflict resolution is needed, then verifies the result with git log.

Can I use this to sync worktrees before creating or updating pull requests?

Yes. Synchronizing worktrees with main before opening or updating PRs prevents merge conflicts and ensures your feature branch is based on current code. This Skill is designed for exactly this use case—keeping feature branches in separate worktrees aligned with remote main before PR operations.

What happens if a feature branch has diverged significantly from main?

Significant divergence increases conflict risk but doesn't prevent synchronization. This Skill fetches latest main changes and rebases or merges your feature branch against them, surfacing conflicts for resolution. Regular synchronization prevents extreme divergence by keeping branches current throughout development.

Do I need to manually fetch from the remote before using this Skill?

No. This Skill includes the fetch step as part of its workflow—it pulls updates from origin automatically before syncing feature branches. You only need to ensure your local repository exists and you're working with standard Git worktrees.