git-cow

command
v0.6.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

git-cow

APFS copy-on-write git worktrees built on github.com/tmc/apple/x/apfs (zero-cgo clonefile(2) + F_LOG2PHYS_EXT extent inspection).

Maintains one hidden per-repository template checkout (.git-cow/<repo>) and CoW-clones both tracked files and ignored build/cache directories (target/, node_modules/, .next/, .turbo/, etc.) into each new worktree. On volumes that do not support APFS cloning (apfs.ErrUnsupported) or with GIT_COW=0, it falls back cleanly to plain git worktree add.

Usage

# Self-contained APFS CoW demo (16 MB build artifact, physical extent sharing proof):
go run ./examples/kernel/git-cow demo

# Install as `git cow` subcommand:
go build -o ~/bin/git-cow ./examples/kernel/git-cow
git cow add -b feat/login
git cow list --shared
git cow warm ~/.worktrees/<repo>/login
git cow remove --warm ~/.worktrees/<repo>/login
git cow cleanup -n

Configuration (git config)

Key Default Description
cow.root ~/.worktrees Default root for add when no path is given (supports ~, {repo})
cow.base <parent>/.git-cow/<repo> Override template checkout path (supports ~, {repo})
cow.share (empty) Extra hidden directories to CoW-clone (multi-valued)
cow.warmInterval 1h Auto-warm cadence (0, 30m, 1h, never)
GIT_COW=0 (unset) Disable CoW cloning and fall back to plain git worktree add

Safety

  • remove refuses to remove the main checkout or the internal .git-cow template checkout.
  • cleanup keeps unmerged, detached, dirty (unless -f), and current-directory worktrees, and saves every deleted branch to refs/git-cow/deleted/<timestamp>/branch/<name> before deleting it.

Documentation

Rendered for darwin/amd64

Overview

Command git-cow creates git worktrees backed by APFS copy-on-write clones using github.com/tmc/apple/x/apfs (zero-cgo clonefile(2) and F_LOG2PHYS_EXT).

Like gabrielkoerich/git-cow, it maintains one hidden template checkout per repository (.git-cow/<repo>) and clones both tracked files and ignored build directories (target/, node_modules/, .next/, etc.) into each new worktree so gigabyte build trees start instantaneously with near-zero extra disk usage.

Usage:

git-cow add [-f] [-b <branch>] [<path>] [<commit-ish>]
git-cow list [--shared]
git-cow warm <worktree>
git-cow remove [--warm] [-f] <worktree>
git-cow cleanup [-n] [-f] [<branch>]
git-cow demo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL