wm

command module
v0.0.0-...-84df7eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 1 Imported by: 0

README

WM - Git Worktree Manager

A CLI tool that makes git worktree easier to use with file sync and background tasks.

Installation

npm / npx
# Run directly
npx gitwm --help

# Or install globally
npm install -g gitwm
wm --help
Go
go install github.com/Devdha/wm@latest
Binary

Download from GitHub Releases

Quick Start

# Initialize in your project
wm init

# Create a worktree for a feature branch
wm add feature-login

# List all worktrees
wm list

# Remove a worktree
wm remove ../wm_myrepo/feature-login

# Remove worktree and delete branch
wm remove -b ../wm_myrepo/feature-login

Configuration

WM uses a .wm.yaml file in your project root:

version: 1

worktree:
  base_dir: "../wm_{repo}"  # {repo} is replaced with repo name

sync:
  - ".env"                              # Copy .env to worktree
  - "apps/*/.env"                       # Glob patterns supported
  - src: ".env.example"
    dst: ".env"
    mode: copy                          # or "symlink"
    when: missing                       # or "always"

tasks:
  post_install:
    mode: background                    # Run async
    commands:
      - "pnpm install"

Commands

wm init

Interactive setup to create .wm.yaml.

wm add <branch>

Create a new worktree. Options:

  • --path, -p: Custom worktree path
wm list

List all worktrees in table format.

wm remove <path>

Remove a worktree. Options:

  • -f, --force: Skip confirmation
  • -b, --branch: Also delete the branch

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
git
ui
workspace
Package workspace provides the core domain logic for worktree management.
Package workspace provides the core domain logic for worktree management.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL