[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115288":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":28,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},115288,"git-twig","leostera\u002Fgit-twig","leostera","lightweight git-worktrees for agents","https:\u002F\u002Ftwig.leostera.dev",null,"Rust",288,14,144,4,0,3,49,23,74.14,"MIT License",false,"main",[25,26,27],"agents","git","worktrees","2026-11-23 14:18:26","2026-11-23 19:20:47","# git twig 🌱\n\nWith twig, your agents can create cheap lightweight worktrees and use up to 97% less space on disk. Imagine all the worktrees you could now make!\n\n## Install\n\n```sh\nbrew tap leostera\u002Fgit-twig https:\u002F\u002Fgithub.com\u002Fleostera\u002Fgit-twig\nbrew install leostera\u002Fgit-twig\u002Fgit-twig\n```\n\nOr install from crates.io with Rust 1.95+ and Git 2.40+:\n\n```sh\ncargo install git-twig --locked\n```\n\nFor local development: `cargo install --path crates\u002Fgit-twig --locked`.\n\n## Use\n\nWith your source checkout in `main\u002F`:\n\n```sh\ngit -C main twig new -b feat\u002Fx ..\u002Ffeat-x HEAD\ngit -C main twig list\n```\n\nVersion 0.5.0 can reuse matching files from nearby worktrees for other revisions\ntoo. Git writes changed, new or converted files.\nShort help works outside a checkout: `git twig -h` or `git twig new --help`.\n\nFor coding agents: `git twig skill` prints the bundled skill. Give those\ninstructions to your agent so it chooses the right checkout, branch and location,\nuses Twig for creation, and asks before cleanup. Twig does not manage agent sessions\nor intercept an app's built-in worktree creation; no client-specific hook is needed\nfor agent-directed CLI use.\n\nNative CoW is verified on macOS\u002FAPFS and Linux Btrfs\u002Freflink-enabled XFS,\nincluding the tested OverlayFS layouts below.\nCreates ordinary linked worktrees from committed files; local changes and ignored\nfiles aren't copied. Unsupported filesystems (including typical ext4), options and\ncheckout semantics use `git worktree`. Set `TWIG_TRACE=1` to see backend selection.\n\nThe selected donor, destination and Git metadata must share a clone-capable filesystem for\nnative CoW. Twig verifies cloned files against the requested commit; writes are\nprivate, never hardlinked to source. Staging lives under the common Git directory\nin `twigs\u002Fstaging` and is removed after success. Failed\u002Finterrupted attempts retain\nstaging and may leave a partial registered worktree; inspect before retrying.\n\n### Organize existing worktrees (development main)\n\nKeep agent checkouts beside the original clone, rather than nested inside it:\n\n```sh\ngit twig adopt --dry-run --worktrees-dir=\u002Fpath\u002Fto\u002Frepo\ngit twig adopt --worktrees-dir=\u002Fpath\u002Fto\u002Frepo\n```\n\nTwig previews `\u002Fpath\u002Fto\u002Frepo\u002F{main,feat-x,...}` and asks before moving anything.\nOmit the directory flag to choose a root interactively; it is remembered per\nrepository. Pass a worktree path to adopt just that checkout. After adoption,\n`git twig new -b feat\u002Fx` uses the saved root automatically.\n\nCoordinate active agents\u002Feditors first: their stored paths are not updated.\nMoves preserve branches and staged, dirty, untracked and ignored files, stay on\none filesystem and never overwrite destinations. Recovery journals are retained.\nLayout moves also require a successful atomic no-overwrite directory-rename\nprobe; unsupported drivers are refused before any worktree moves. Submodule\nrelocation is not yet supported. Linux can subsequently deduplicate\nmatching files in place. On macOS, interactive adoption also offers **offline\ncompaction**: save work and close agents, editors, builds and servers using these\nworktrees first. It replaces matching files with verified CoW clones, preserves\nsupported target metadata and staged\u002Fdirty contents, then retires verified old\ncopies. Inodes change, so the next Git status may refresh its stat cache.\n\n```sh\ngit twig adopt --compact --dry-run --worktrees-dir=\u002Fpath\u002Fto\u002Frepo\n# After reviewing the plan and saving\u002Fclosing every donor\u002Ftarget worktree:\ngit twig adopt --compact --worktrees-dir=\u002Fpath\u002Fto\u002Frepo\n```\n\nFor already-approved automation, macOS requires `--compact --offline --yes`;\n`--yes` alone remains move-only. `--move-only` explicitly disables sharing on\nboth platforms. Busy originals cannot be retired; failure retains copies and a\njournal for recovery. Never restart agents blindly after a compaction failure.\nLogical matching bytes are not guaranteed physical space reclaimed, and neither\nsnapshots nor unrelated backups are deleted. This is not live APFS deduplication.\n\nThis layout flow is unreleased; published v0.5.0 has the earlier sharing-only\n`adopt`. Check `git twig adopt -h` for `--worktrees-dir` and `--compact` before\nfollowing these flows.\n\n## Filesystem support\n\n| Platform | Filesystem | CoW \u002F fallback | Verification |\n|---|---|---|---|\n| macOS | APFS | Native `clonefile` | Tests, CI and allocation benchmarks |\n| Linux | Btrfs | Native `FICLONE` | Tests, CI and allocation benchmarks |\n| Linux | XFS with `reflink=1` | Native `FICLONE` | Tests, CI and allocation benchmarks |\n| Linux | Typical ext4 | Stock Git fallback; no reflink savings | Full checkout test matrix |\n| Linux | tmpfs | Stock Git fallback; no reflink savings | Checkout matrix and mixed-mount isolation |\n| Linux | exFAT \u002F VFAT | Stock Git fallback; filesystem limitations apply | Portable checkout subset, not full POSIX semantics |\n| Linux | XFS with `reflink=0` | Stock Git fallback expected | Not separately verified |\n| Linux | OverlayFS over ext4 | Stock Git fallback | Checkout matrix and lower-layer preservation tests |\n| Linux | OverlayFS over reflink-enabled XFS \u002F Btrfs | Native `FICLONE` in tested layouts | Checkout matrix, copy-up and private-write tests |\n| Linux | NTFS (`ntfs3`, ACL-enabled) | Stock Git fallback; no reflink savings | Checkout matrix; UTF-8 name restrictions apply |\n| Linux | NTFS (`ntfs-3g`, permissions enabled) | Stock Git fallback; no reflink savings | Checkout matrix; UTF-8 name restrictions apply |\n| Linux | OpenZFS 2.2.2 (tested guest) | Synced-source `FICLONE`; dirty data may delegate | 80 checkout tests with Git 2.43; minimum-Git environment incomplete |\n| Linux | NFSv4.2 over tested XFS\u002FZFS server | Clone probes accepted | Full checkout suites budget-stopped; not verified support |\n| Linux | bcachefs | Exploratory; no support claim | Not verified |\n\nLinux uses the actual clone operation, not a filesystem-name allowlist. Clone\nrefusals before registration fall back to stock Git; failures after registration\nretain partial state for inspection. An accepted clone does not guarantee useful\ndisk savings, especially for tiny files. Verification covers the tested setups,\nnot every kernel, mount option or checkout policy. OverlayFS coverage includes\nfresh upper-layer repositories and repositories seeded in lowerdir before mount;\nit is not an allocation benchmark. See [Linux test setup](bench\u002Flinux.md).\nCheckout policy coverage below is separate from filesystem capability.\n\n## Checkout policies\n\nVersion 0.4.0 supports common LF policies such as `text=auto eol=lf`.\nThey compare private clones to raw target blobs and let Git write exceptional\nfiles, retaining sharing for the rest. Version 0.5.0 also chooses a donor\nacross revisions and lets Git write builtin ident\u002Fencoding exceptions. External\nfilters and sparse checkout still delegate. Submodules are Git-written empty\ndirectories, never copied or recursively initialized from a donor.\nSee the [changelog](CHANGELOG.md) for release details.\n\nWith `TWIG_TRACE=1`, native creation reports verified-clone and Git-written path\ncounts. Delegation reports its specific cause; an attribute refusal names the\npath, attribute, and value (for example `filter=\"unspecified\" on \"file.txt\"`).\nDo not override repository attributes with `-text` just to force the fast path:\nthat changes Git checkout semantics rather than proving the bytes are correct.\n\n## Benchmarks\n\n### v0.5 checkout coverage\n\nShare unchanged files across revisions, builtin conversions and submodule checkouts.\nThese synthetic workloads measure a frozen pre-release candidate, not the published\nbinary; faster creation is not guaranteed. They do not measure experimental `adopt`.\n\n\u003C!-- twig-preview:start -->\n\n| Workload · APFS | Stock Git | Twig v0.4 | v0.5 candidate |\n|---|---|---|---|\n| Cross-revision | 139ms \u002F 128.09 MiB | 181ms \u002F 128.09 MiB | 884ms \u002F 16.08 MiB |\n| Builtin conversions | 145ms \u002F 128.11 MiB | 372ms \u002F 128.12 MiB | 923ms \u002F 88.00 KiB |\n| Auto CRLF | 392ms \u002F 128.09 MiB | 803ms \u002F 128.09 MiB | 614ms \u002F 88.00 KiB |\n| Submodules | 138ms \u002F 128.09 MiB | 267ms \u002F 128.09 MiB | 900ms \u002F 72.00 KiB |\n| Unchanged bytes | 134ms \u002F 128.07 MiB | 853ms \u002F 68.00 KiB | 880ms \u002F 68.00 KiB |\n| 4,096 small files | 1.11s \u002F 36.41 MiB | 2.07s \u002F 3.31 MiB | 2.08s \u002F 3.38 MiB |\n\nEach cell is **creation time \u002F additional disk allocation**. Medians of 3\ntwo-worktree batches, one create at a time, on warm-cache filesystem images.\nSynthetic workloads, not real-repository or universal speed claims. Allocation\nincludes Git metadata after first status; it is not exclusive file space reclaimed.\n\nAcross all levels: 992 certified creates; 2 failed points and 1 unstable observation retained.\n\nOther filesystems: [APFS (case-sensitive)](bench\u002Fresults\u002Fsha256-c4989db26497\u002Fmacos-apfs-case-sensitive\u002F2026-11-17\u002Fcheckout-v05\u002Fcomparison.svg) · [XFS](bench\u002Fresults\u002Fsha256-a73d956e3301\u002Flinux-xfs\u002F2026-11-17\u002Fcheckout-v05\u002Fcomparison.svg) · [Btrfs](bench\u002Fresults\u002Fsha256-a73d956e3301\u002Flinux-btrfs\u002F2026-11-17\u002Fcheckout-v05\u002Fcomparison.svg).\nSpeed varies by workload. [Full results and limitations](bench\u002Fpreview.md).\n\n\u003C!-- twig-preview:end -->\n\n\u003Cdetails>\n\u003Csummary>v0.4 real-repository benchmarks\u003C\u002Fsummary>\n\n\u003C!-- twig-bench:start -->\n\n\u003C!-- Generated from bench\u002Fresults\u002Freadme.json by twig-readme-table. Do not edit numbers. -->\n\n| Repo | `git worktree` | `git twig` | Improvement |\n|---|---|---|---|\n| [Workers starter (10 sequential)](bench\u002Fresults\u002Fsha256-428608b8bf13\u002Fmacos-apfs-mixed\u002F2026-11-17\u002Ffinal\u002Fworkers-starter-host.json) | 456ms \u002F 592 KiB | 4.27s \u002F 308 KiB | 9.37× slower \u002F **1.9× less space** |\n| [git-twig (10 sequential)](bench\u002Fresults\u002Fsha256-428608b8bf13\u002Fmacos-apfs-mixed\u002F2026-11-17\u002Ffinal\u002Ftwig-host.json) | 422ms \u002F 5.2 MiB | 4.18s \u002F 508 KiB | 9.91× slower \u002F **10.6× less space** |\n| [Axo](bench\u002Fresults\u002Fsha256-428608b8bf13\u002Fmacos-apfs-mixed\u002F2026-11-17\u002Ffinal\u002Faxo-host.json) | 400ms \u002F 30.8 MiB | 948ms \u002F 1.2 MiB | 2.37× slower \u002F **26.7× less space** |\n| [Linux kernel](bench\u002Fresults\u002Fsha256-428608b8bf13\u002Fmacos-apfs-mixed\u002F2026-11-17\u002Ffinal\u002Flinux-images.json) | 40.56s \u002F 1.8 GiB | 31.32s \u002F 44.7 MiB | 1.29× faster \u002F **41.9× less space** |\n| [OpenClaw](bench\u002Fresults\u002Fsha256-428608b8bf13\u002Fmacos-apfs-mixed\u002F2026-11-17\u002Ffinal\u002Fopenclaw-host.json) | 8.58s \u002F 919 MiB | 8.80s \u002F 31.1 MiB | 1.03× slower \u002F **29.5× less space** |\n| [Pulumi docs](bench\u002Fresults\u002Fmulti-build\u002Fmixed\u002F2026-11-17\u002Fissue5\u002Fafter-host.json) | 4.32s \u002F 1.2 GiB | 3.64s \u002F 7.9 MiB | 1.19× faster \u002F **155.8× less space** |\n\nEach cell is **creation time \u002F additional disk space**. Batch sizes differ; creation excludes first status. † Includes failed Git attempts. [Setup and raw results](bench\u002Fresults\u002Freadme-details.md).\n\n\u003C!-- twig-bench:end -->\n\n\u003C\u002Fdetails>\n\nFor Linux CLI time\u002Fallocation measurements, see [Linux benchmarks](bench\u002Flinux.md).\n\n## Develop\n\n```sh\ncargo fmt --all --check\ncargo clippy --workspace --all-targets --locked -- -D warnings\ncargo test --workspace --locked\n```\n\nLinux CI tests the host filesystem plus reflink-enabled XFS and Btrfs images,\nrequiring native CoW on both. Locally on a supported Linux filesystem, run\n`TWIG_TEST_REQUIRE_NATIVE=1 cargo test -p git-twig`. Tests and benchmarks retain\nfixtures under `target\u002F`; disk use grows. See the\n[design contract](docs\u002Frfds\u002FRFD0001-verified-cow-worktrees.md),\n[Linux correctness boundaries](docs\u002Frfds\u002FRFD0012-linux-correctness-and-measurement.md),\n[changelog](CHANGELOG.md), and [release operations](docs\u002Freleases.md).\n\n[MIT](LICENSE)\n","git-twig 是一个为 AI 编程代理（agents）设计的轻量级 Git 工作树（worktree）管理工具。它基于文件系统原生写时复制（CoW）能力（如 APFS、Btrfs、reflink XFS），在创建新工作树时复用未修改文件，使磁盘占用降低最多 97%；同时兼容传统文件系统并自动回退到标准 git worktree。支持快速创建、列出、迁移和回收工作树，并提供专为编码代理优化的 CLI 接口与技能指令（skill）。适用于需要高频、隔离式代码分支操作的 AI 编程代理、自动化代码评审、多任务并行开发等场景。",2,"2026-11-24 04:50:34","CREATED_QUERY"]