Git WORktree Manager
demo.mp4
A better git worktree manager. Built with Xclif.
git worktree is powerful but raw. git-worm adds:
- Automatic file management — gitignored files (
.env,.venv,node_modules, etc.) are copied into new worktrees so switching feels likegit switch - Smart package manager detection — pnpm/bun/Yarn PnP users don't get unnecessary
node_modulescopies - Nice UI — Rich-formatted output, tree views, colored status. You can also create multiple worktrees in one command!
Requires Python 3.12+
pip install git-wormOr with uv:
uv tool install git-wormBecause of Xclif, git-worm automatically gets a very nice-looking help page
# Create a new worktree (copies .env, .venv, etc. automatically)
git worm new feat-login
# Create from a specific ref
git worm new feat-login --from-ref main
# List all worktrees
git worm list
# Print worktree path
git worm switch feat-login
# Remove a worktree
git worm rm feat-login
# Remove even if dirty
git worm rm feat-login --force
# Shell integration (add to .bashrc/.zshrc)
eval "$(git-worm shell-init)"
# Then: worm switch feat-login (auto-cds)git-worm shell-init outputs a worm shell function that wraps git-worm. This is needed because worm switch needs to cd into the worktree directory, which a plain subprocess can't do. All other commands are forwarded to git-worm as-is.
Add this to your .bashrc or .zshrc:
eval "$(git-worm shell-init)"Then use worm instead of git-worm:
worm new feat-login
worm switch feat-login # cds into the worktree
worm listOptional .git-worm.toml in your repo root:
[settings]
worktree_dir = ".worktrees" # default
[[share]]
path = ".env*"
strategy = "copy"
[[share]]
path = "node_modules"
strategy = "ignore"
[[share]]
path = "target"
strategy = "symlink"Strategies: copy, reflink (COW, falls back to copy), symlink, ignore.
When a config file is present, it replaces the default behavior entirely.
- All gitignored files/dirs are detected
.git/and.worktrees/are excluded- Files are plain-copied, directories are reflinked (with copy fallback)
node_modules/is skipped if pnpm, bun, or Yarn PnP is detected
Public Domain
