wm-git-worktree-manager
Efficiently manage git worktrees with automated file synchronization, background task execution, and CLI-based workspace orchestration.
Introduction
The wm (Git Worktree Manager) skill is a powerful CLI utility designed for developers who maintain multiple concurrent feature branches. It streamlines the git worktree workflow by automating the creation, management, and cleanup of isolated workspaces, effectively solving the friction of branch switching and stashing. This tool is intended for software engineers working in repositories with complex CI/CD pipelines, long-running build processes, or those needing to balance multiple pull requests simultaneously.
-
Automatically creates isolated git worktrees for specific branches, allowing developers to work on multiple features in parallel without constant branch switching or state stashing.
-
Supports intelligent file synchronization, allowing users to define rules in .wm.yaml to copy or symlink critical configuration files like .env or project-specific settings into newly created worktrees.
-
Triggers automated post-install tasks, such as running npm install, pnpm install, or custom background scripts, ensuring new worktrees are development-ready immediately upon creation.
-
Detects remote branches automatically, enabling seamless fetches from git origins when starting work on a new feature that exists on a remote server but not locally.
-
Provides a robust CLI interface with support for explicit arguments, making it ideal for integration into automated environments, CI/CD pipelines, and script-heavy development workflows.
-
Includes protective features such as main worktree protection to prevent accidental deletion of critical project roots and standardized naming conventions for branches with slashes.
-
Ensure the presence of a .wm.yaml configuration file in the project root to define base directories, file sync patterns, and post-installation task commands for consistent workspace environments.
-
Use explicit command arguments (e.g., wm add <branch>) rather than interactive mode when operating within automated scripts to avoid process hangs, as interactive mode requires a terminal TTY.
-
Utilize the wm list command to monitor all active worktrees and their associated git branches or HEAD states in a structured, readable format.
-
Manage complex branch structures where branch names containing slashes (e.g., feature/auth) are automatically converted to flat directory names (feature-auth) to ensure path safety and OS compatibility.
-
Use the -b flag with the remove command to simultaneously delete the git worktree directory and the associated git branch, streamlining cleanup tasks after feature completion or PR merging.
Repository Stats
- Stars
- 8
- Forks
- 0
- Open Issues
- 0
- Language
- Go
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 3, 2026, 06:47 PM