wt

Manage git worktrees for parallel branch development and merging.

2|Updated Jun 7, 2022
One-click install
npx skills add https://github.com/SebasAren/dotfiles --skill wt-sebasaren
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wt
Source: https://github.com/SebasAren/dotfiles/tree/main/pi/.pi/agent/skills/wt
Command: npx skills add https://github.com/SebasAren/dotfiles --skill wt-sebasaren

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Eliminates the friction of working on multiple branches in a single clone by managing isolated git worktrees so developers and agents can work in parallel without stashing or repeated cloning.

Core Features & Use Cases

  • Create and switch worktrees by branch: address worktrees by branch name, create from specific bases, or open PR/MR branches directly.
  • Merge pipeline and cleanup: commit, squash, rebase, run pre-merge hooks, merge into the default branch, and prune integrated worktrees.
  • Automation and inspection: list worktrees with JSON output for scripting, run steps across worktrees, and configure lifecycle hooks for CI, tests, and deployments.
  • Real-world example: run concurrent AI agent tasks each in its own worktree, monitor progress with wt list --full, and merge completed feature work back to main.

Quick Start

Run wt switch --create feature-name to create a new worktree for a feature and begin development in an isolated workspace.

Frequently Asked Questions about wt

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

FAQPage Schema
How do I manage multiple git branches in parallel without stashing or cloning?

Git worktrees enable parallel branch development by creating isolated working directories within a single repository, eliminating the friction of stashing or repeated cloning. You can address worktrees by branch name and switch between them effortlessly.

What is the best way to run parallel agent tasks in a single git repository?

The best way to run parallel agent tasks is using isolated git worktrees for each task within a single repository. You can monitor progress with JSON-formatted listings and merge completed work back to the default branch through a structured pipeline.

How do I merge a git worktree back into the main branch?

To merge a git worktree back into the main branch, use a merge pipeline that commits, squashes, and rebases changes before merging. The pipeline runs pre-merge hooks for CI and tests, then automatically prunes the integrated worktree for cleanup.

Can I list git worktrees in JSON format for scripting automation?

Yes, you can list git worktrees with JSON output specifically designed for scripting automation. This allows you to programmatically inspect worktree states, run steps across multiple worktrees, and integrate with external CI or deployment lifecycle hooks.

Does git worktree management support lifecycle hooks for CI and tests?

Git worktree management supports configuring lifecycle hooks for CI, tests, and deployments. You can trigger these hooks automatically during worktree creation, switching, or within the merge pipeline to validate code quality before branch integration.

When should I avoid using git worktrees for branch management?

You should avoid using git worktrees when working on a single linear task without parallel development needs, as the overhead of managing isolated directories and lifecycle hooks provides no benefit over standard branch switching in a single working directory.