Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

leostera/git-twig

Developer Tools

A Git extension that creates copy-on-write worktrees to cut disk use for parallel agent checkouts.

127
2
Rust
MIT
1 day old

What it does

git twig is a Git subcommand that creates linked worktrees using copy-on-write clones instead of full file copies. It targets coding agents and workflows that spin up many worktrees in parallel, trading some creation time for substantially less disk usage. On unsupported filesystems or revision modes it falls back to plain git worktree.

It creates ordinary linked worktrees from committed files; local changes and ignored files are not carried over. Twig verifies cloned files against the requested commit, and staged writes are private rather than hardlinked to the source.

Install and first worktree

Requires Git 2.40+; installing from crates.io also requires Rust 1.95+. Install via Homebrew:

brew tap leostera/git-twig https://github.com/leostera/git-twig
brew install leostera/git-twig/git-twig

Or from crates.io:

cargo install git-twig --locked

With an existing checkout in main/, create a worktree at ../feat-x for branch feat/x at HEAD:

git -C main twig new -b feat/x ../feat-x HEAD
git -C main twig list

The result is a registered linked worktree usable by normal Git commands. git twig -h and git twig new --help work outside a checkout, and git twig skill prints the bundled agent skill.

Filesystem and correctness constraints

Native CoW requires macOS/APFS or Linux on Btrfs or reflink-enabled XFS; typical ext4 falls back to git worktree. Source, destination and Git metadata must share a clone-capable filesystem. Only the source checkout's current HEAD supports native CoW; other revisions go through Git. Set TWIG_TRACE=1 to see which backend was chosen.

Staging data lives under the common Git directory in twigs/staging and is removed on success. A failed or interrupted run may leave staging and a partially registered worktree behind, so inspect before retrying.

Performance and limitations

The published benchmarks compare creation time against additional disk space. On a small starter repo twig was 3.30x slower but used 1.6x less space; on Axo it was 2.02x faster with 18.8x less space; on ten sequential Linux kernel worktrees it was 1.40x slower with 34.2x less space. Batch sizes differ, so figures are not directly comparable across rows. See the setup and raw results and Linux measurements for method.

Because the space win depends on the filesystem, twig's main benefit does not appear on default ext4 setups. Its slower path on smaller repos means the tradeoff favors large checkouts or many parallel worktrees.

HotRepo's take

HotRepo's only recorded snapshot is the 2026-11-16 new-project list, where git-twig showed 128 stars and 18 stars gained in about an hour of observation. That is a single short window and does not establish a trend, but it puts the project in front of developers exploring agent-oriented Git tooling. The notable technical split is that the disk savings are filesystem-dependent while fallback behavior stays compatible with existing worktrees, so readers can evaluate it on their own filesystem rather than assuming the benchmark ratios apply everywhere.

Written by AI from the project's README, updated . The project's own docs are the source of truth.

You might also like

  1. max-sixty/worktrunkA CLI that turns Git worktrees into branch-like commands, so parallel AI coding agents each get an isolated directory.Rust9,457
  2. stencil-hq/ovnfsCopy-on-write filesystem checkouts that let coding agents work on any folder without touching the original.Go105
  3. go-git/go-gitA pure-Go Git library so Go programs can clone, read and write repositories without shelling out to the git binary.Go7,830
  4. gitbutlerapp/gitbutlerA Git client with GUI and CLI that replaces manual rebasing with stacked and parallel branches for developers juggling several changes.Rust21,849
  5. jesseduffield/lazygitA terminal interface for Git that turns staging, rebasing and history edits into guided keyboard actions.Go83,495