GWT Git Worktree Management

VerifiedSafe

Manage Git worktrees with the gwt command-line tool for efficient branch-based workflows. Worktrees allow you to work on multiple branches simultaneously without stashing changes. gwt automates creation, switching, listing, and cleanup of worktrees, especially useful when context-switching between tasks or cleaning up after merging pull requests.

Sby Skills Guide Bot
DevelopmentIntermediate
1006/2/2026
Claude Code
#git#worktree#branch-management#productivity

Recommended for

Our review

Manages Git worktrees with the gwt tool to work on multiple branches simultaneously.

Strengths

  • Automatic directory switching to the correct worktree
  • Centralized worktree storage in ~/.gwt_store
  • Just-in-time worktree creation when switching branches
  • Smart remote branch discovery and tracking

Limitations

  • Requires gwt to be installed on the system
  • Learning curve for understanding worktree concepts
  • Only works if the repository is compatible with gwt's setup
When to use it

Use gwt when you need to switch between branches for code review, testing, or working on multiple features in parallel without stashing changes.

When not to use it

Avoid gwt if you only work on a single branch or prefer using raw git commands.

Security analysis

Safe
Quality score88/100

The skill describes standard git worktree management commands via the 'gwt' tool. There are no destructive commands, exfiltration attempts, obfuscation, or disabling of safety mechanisms. All listed operations are local to the repository and expected for branch management.

No concerns found

Examples

Switch to a feature branch
Switch to branch 'feature/new-login' using gwt, creating a worktree if it doesn't exist.
List all worktrees
List all my git worktrees with truncated branch names.
Clean up after merge
Remove the worktree for branch 'feature/old-ui' and delete the branch since it's been merged.

name: gwt description: Manage git worktrees using gwt for branch-based workflow. Use when switching branches, creating worktrees, listing worktrees, or cleaning up after merging PRs.

GWT Worktree Management Skill

You have access to gwt, a Git worktree management tool that simplifies working with multiple branches simultaneously. Use gwt instead of raw git worktree commands for a streamlined workflow.

Available Commands

Switch to a Branch Worktree

gwt sw <branch>           # Switch to existing branch (creates worktree if needed)
gwt sw -b <branch>        # Create new branch and switch to it
gwt sw -m                 # Switch to main/master branch
gwt sw <branch> --remote <remote>  # Switch to branch from specific remote

List Worktrees

gwt ls                    # List all worktrees (truncated branch names)
gwt ls --full             # List with full branch names

Remove Worktrees

gwt rm <branch>           # Remove worktree for branch (prompts for confirmation)
gwt rm <branch> -y        # Remove without confirmation
gwt rm <branch> -b        # Remove worktree and delete the branch
gwt rm <branch> -B        # Remove worktree and force-delete branch
gwt rm --this             # Remove current worktree (switches to home first)

Navigation

gwt home                  # Return to the main repository worktree
gwt current               # Show current branch and worktree path (alias: gwt c)

Workflow Patterns

Starting Work on a Feature

  1. Use gwt sw -b feature/name to create a new branch and worktree
  2. Work on the feature in the isolated worktree
  3. The original repository remains on its branch

Switching Between Tasks

  1. Use gwt sw other-branch to switch to another worktree
  2. No need to stash changes - each worktree is independent
  3. Use gwt ls to see all available worktrees

Cleaning Up After PR Merge

  1. Use gwt home to return to main repository
  2. Use gwt rm feature/name -b to remove worktree and delete merged branch
  3. Or use gwt rm --this -b if still in the feature worktree

Checking Current Location

Use gwt current to see which branch and worktree you're in.

Key Benefits

  • Automatic directory switching: gwt changes your shell's working directory automatically
  • Centralized storage: Worktrees are stored in ~/.gwt_store, keeping repos clean
  • Just-in-time creation: Worktrees are created automatically when switching to new branches
  • Smart remote lookup: Automatically finds and tracks remote branches

When to Use gwt

  • Switching between branches for code review or testing
  • Working on multiple features in parallel
  • Isolating experimental changes without affecting main work
  • Quick context switching without stashing changes
Related skills