A better git worktree manager
Project description
git-worm
Git WORktree Manager
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 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!
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
# 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)
- 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
License
Public Domain
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file git_worm-0.4.0.tar.gz.
File metadata
- Download URL: git_worm-0.4.0.tar.gz
- Upload date:
- Size: 635.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b43091bef44bf7ab4c3f6782d16f57ba9e5f1605e88ea0f366c6a38b308e93c1
|
|
| MD5 |
bfd94c01e0357ab98dc96c21f5528d01
|
|
| BLAKE2b-256 |
371061c346057355faf50c5ac55d4a5b92765d0078e5267fd16dd8decf981a84
|
Provenance
The following attestation bundles were made for git_worm-0.4.0.tar.gz:
Publisher:
release.yml on ThatXliner/git-worm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
git_worm-0.4.0.tar.gz -
Subject digest:
b43091bef44bf7ab4c3f6782d16f57ba9e5f1605e88ea0f366c6a38b308e93c1 - Sigstore transparency entry: 1366379745
- Sigstore integration time:
-
Permalink:
ThatXliner/git-worm@4e87bafb8568eab8dacc21c559a834009660262f -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/ThatXliner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4e87bafb8568eab8dacc21c559a834009660262f -
Trigger Event:
release
-
Statement type:
File details
Details for the file git_worm-0.4.0-py3-none-any.whl.
File metadata
- Download URL: git_worm-0.4.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07e5615a9c8b6183b92a46933a30aa7b17146d58f7c64953f6d94d2b34e356c7
|
|
| MD5 |
4ad5a7805d15366605d38b49e2a78aad
|
|
| BLAKE2b-256 |
aace31f6e83aa82d113f8d8aff5d0c0be65de367b332062ba2b1a10eec907cf0
|
Provenance
The following attestation bundles were made for git_worm-0.4.0-py3-none-any.whl:
Publisher:
release.yml on ThatXliner/git-worm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
git_worm-0.4.0-py3-none-any.whl -
Subject digest:
07e5615a9c8b6183b92a46933a30aa7b17146d58f7c64953f6d94d2b34e356c7 - Sigstore transparency entry: 1366379811
- Sigstore integration time:
-
Permalink:
ThatXliner/git-worm@4e87bafb8568eab8dacc21c559a834009660262f -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/ThatXliner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4e87bafb8568eab8dacc21c559a834009660262f -
Trigger Event:
release
-
Statement type: