worktree

Manage Git worktrees with gtr commands for create, list, and remove.

2|Updated Apr 6, 2017
One-click install
npx skills add https://github.com/shiiman/dotfiles --skill worktree-shiiman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/shiiman/dotfiles/tree/main/ai/codex/skills/worktree
Command: npx skills add https://github.com/shiiman/dotfiles --skill worktree-shiiman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

gtr worktree management makes it easy to create, list, and remove Git worktrees without manually juggling commands or paths.

Core Features & Use Cases

  • Create new worktrees from a base branch with git gtr new, including optional --from-current and --editor.
  • List all existing worktrees with git gtr list, including detail formatting for quick review.
  • Remove a worktree with git gtr rm, with safety checks and optional --force; open editors or AI tools with dedicated commands.
  • Open a worktree in an editor or Claude Code with git gtr editor / git gtr ai.

Quick Start

Use git gtr to create a new worktree, list current worktrees, or remove an existing one.

Frequently Asked Questions about worktree

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

FAQPage Schema
How do I manage Git worktrees for multiple feature branches without juggling commands?

Git worktree management streamlines creating, listing, and removing worktrees using gtr commands. It enables rapid creation from a base branch, provides a quick overview of current worktrees, and performs safe cleanup to simplify multi-branch workflows.

How do I create a new Git worktree from a specific base branch?

To create a Git worktree, use the gtr new command with an optional base branch specification. You can apply the --from-current flag to branch from your active state and --editor to immediately launch the new worktree in your configured editor.

Do I need gtr installed to manage Git worktrees with this workflow?

Yes, you must have the gtr command-line tool installed and operate within an existing Git repository. This workflow relies entirely on gtr to execute worktree creation, listing, and removal commands safely.

Can I open a Git worktree directly in an editor or AI coding tool?

Yes, you can open a Git worktree directly using the gtr editor or gtr ai commands. This integrates your worktree management with your development environment, including optional Claude Code integration for AI-assisted workflows.

What is the safest way to remove a Git worktree?

The safest way to remove a Git worktree is using the gtr rm command, which includes built-in safety checks before deletion. For stubborn or unclean directories, you can apply the --force flag to bypass the standard safety validation.

How do I list all existing Git worktrees in my repository?

You can list all existing Git worktrees by running the gtr list command. This provides a formatted overview for quick review, allowing you to track active feature branches and manage your repository directories efficiently.