Skip to main content

git-worm — a better git worktree manager

git-worm

Git WORktree Manager

CI PyPI - Python Version PyPI PyPI - License

https://github.com/user-attachments/assets/916af237-e959-43fc-9046-067929ad874f

A better git worktree manager. Built with Xclif.

Why?

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 like git switch
  • Smart package manager detection — pnpm/bun/Yarn PnP users don't get unnecessary node_modules copies
  • Nice UI — Rich-formatted output, tree views, colored status. You can also create multiple worktrees in one command!

Install

Requires Python 3.12+

pip install git-worm

Or with uv:

uv tool install git-worm

Usage

Because of Xclif, git-worm automatically gets a very nice-looking help page

Help

# 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)

Shell integration

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 list

Configuration

Optional .git-worm.toml in your repo root:

[settings]
worktree_dir = ".worktrees"  # default
post_create = ["bun install"]

[[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, share rules replace the default behavior entirely.

Post-create hooks

The post_create array runs shell commands in the new worktree after it's created. This is useful for setting up dependencies when node_modules is skipped:

[settings]
post_create = ["pnpm install", "cargo fetch"]

If no post_create hook is configured and node_modules was skipped, git-worm prints a hint with the detected install command.

Default Behavior (no config)

  1. All gitignored files/dirs are detected
  2. .git/ and .worktrees/ are excluded
  3. Files are plain-copied, directories are reflinked (with copy fallback)
  4. node_modules/ is skipped if pnpm, bun, or Yarn PnP is detected

License

Public Domain

Release files for git-worm 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-worm 0.6.0
File Size Uploaded
git_worm-0.6.0.tar.gz 708.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git-worm 0.6.0
File Interpreter ABI Platform
git_worm-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 725.4 kB

Release files / git_worm-0.6.0.tar.gz

Download URL git_worm-0.6.0.tar.gz
Size 708.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4379209a06584f2adfbc90af962b9cf36438e6fbc95dd36d044eeed81d944875
BLAKE2b-256 checksum
How to use checksums
449f00d2e2445d695a3fda2717c5a385227e411ab9343f7405a614fe6da463e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release files / git_worm-0.6.0-py3-none-any.whl

Download URL git_worm-0.6.0-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e12d0770e25f21ba3add057f49a7727c8647fca4ef6522e2e6b916a117ecfa06
BLAKE2b-256 checksum
How to use checksums
0faae20688ed03ee7f19b5c350b3c69688317c013362625c05d35e028fdb4969
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page