Git worktrees that share files through copy-on-write clones (APFS, XFS, btrfs). A git subcommand and a Rust crate
https://docs.rs/git-cow/ โ// momentum
// why it's here
- Created 5 weeks ago and already shipping
- Built almost entirely by one person
- Health 85/100 with only 73 stars
- 8 releases in the last 90 days
// how to help
// readme
git-cow
Git worktrees that share their build output. git-cow keeps one extra checkout of each repository and makes every new worktree a copy-on-write clone of it. So target/, node_modules and other ignored folders take no extra disk until a build changes them. A worktree that would cost gigabytes starts at a few megabytes, and its first build is incremental.
git cow add -b feat/login # ~/.worktrees/<repo>/login
git cow add -b feat/login ../login # any path, like git worktree add
git cow list # your worktrees, without the extra checkout
git cow remove --warm ~/.worktrees/<repo>/login # after a merge: give its build output to the extra checkout, then remove it
Install
cargo install git-cow # into ~/.cargo/bin
Git runs any program named git-<name> on your PATH as git <name>, so git cow works right after the install. If git says cow is not a git command, add ~/.cargo/bin to your PATH:
export PATH="$HOME/.cargo/bin:$PATH" # in your shell profile
For a different name, add an alias: git config --global alias.wt '!git-cow' makes git wt add -b feat/x work.