convert-worktree

Convert a git worktree into a local branch by rebasing onto the base branch.

3|2|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/AdamCaviness/agentic-toolkit --skill convert-worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convert-worktree
Source: https://github.com/AdamCaviness/agentic-toolkit/tree/main/skills/convert-worktree
Command: npx skills add https://github.com/AdamCaviness/agentic-toolkit --skill convert-worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Converts an active git worktree into a regular local branch by rebasing onto the latest base branch, cleaning up resources, removing the worktree, and checking out the branch in the main workspace.

Core Features & Use Cases

  • Rebase the worktree onto the detected base branch (main or master) to ensure the main branch history stays linear.
  • Remove the worktree after transferring work, and switch to the corresponding local branch in the main workspace.
  • Perform project cleanup prior to rebase to preserve environment integrity, while ensuring the overall conversion never blocks on failures.

Quick Start

Run this skill from within a worktree to convert it into a local branch on the main workspace.

Frequently Asked Questions about convert-worktree

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

FAQPage Schema
How do I convert a git worktree into a regular local branch?

To convert a git worktree into a regular local branch, run this skill from within the worktree. It rebases onto the latest base branch, removes the worktree, and checks out the branch in your main workspace.

What is the best way to rebase a worktree onto the main branch?

The best way to rebase a worktree onto the main branch is using an automated conversion process. It dynamically detects the base branch, applies the rebase for linear history, and removes the now-unused worktree.

How does worktree conversion handle project cleanup before checkout?

Worktree conversion performs project cleanup prior to the rebase to preserve environment integrity. The process is non-blocking, ensuring the conversion never fails entirely due to cleanup issues.

Can I preserve work-in-progress commits when converting a worktree to a branch?

Yes, you can preserve WIP commits when converting a worktree. The conversion process satisfies requirements for WIP commits, integrating them into the local branch during the non-blocking rebase.

Does worktree conversion work with both main and master base branches?

Yes, worktree conversion works with both main and master base branches. The process features dynamic base branch detection to automatically identify and rebase onto the correct primary branch.

Why should I remove a worktree after finishing work instead of keeping it?

You should remove a worktree after finishing work to transfer your changes into a clean, tracked local branch in the main workspace. This removes the now-unused worktree, keeping your repository organized.