worktree-sync

Rebase a feature worktree onto its detected base branch.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/cbemister/claude-code --skill worktree-sync-cbemister
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-sync
Source: https://github.com/cbemister/claude-code/tree/main/.claude/skills/worktree-sync
Command: npx skills add https://github.com/cbemister/claude-code --skill worktree-sync-cbemister

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill keeps a feature worktree aligned with its base branch, ensuring you incorporate the latest changes during development and before creating a pull request.

Core Features & Use Cases

  • Automatic base-branch detection (main or master) or explicit base selection.
  • Safe, automated sync workflow: verify location, check for uncommitted changes, fetch updates, and rebase onto origin/base.
  • Clear guidance for post-rebase testing and push strategy.

Quick Start

Run the command /worktree-sync to update your current worktree against the detected base branch, or specify a base like /worktree-sync main.

Frequently Asked Questions about worktree-sync

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

FAQPage Schema
How do I sync a git worktree with its base branch?

To sync a git worktree, you fetch updates from the remote and rebase your feature branch onto the origin base branch, resolving any conflicts to integrate the latest changes before testing and pushing.

What is the best way to update a feature branch before opening a pull request?

Updating a feature branch before a pull request involves detecting the base branch, fetching remote updates, and rebasing your worktree onto origin to ensure your history is current and ready for review.

How do I rebase a feature worktree onto main or master automatically?

Rebasing a feature worktree onto main or master requires detecting the base branch, fetching remote changes, and executing a rebase to align your local commits with the updated base branch history.

Can I sync a git worktree without specifying the base branch?

Yes, you can sync a git worktree without specifying the base branch because the process includes automatic base-branch detection to identify whether your repository uses main or master as the default.

What should I do after rebasing my feature branch onto the base branch?

After rebasing your feature branch onto the base branch, you should execute your test suite to verify stability and then use the guided push workflow to publish your updated commits.

Does syncing a git worktree check for uncommitted changes before rebasing?

Yes, syncing a git worktree verifies the working directory and checks for uncommitted changes before fetching updates and rebasing to prevent losing local modifications during the branch synchronization.