This sounds really cool, can you explain how you do this?
cp -R --reflink=always /path/to/source /path/to/dest
On macOS with APFS: cp -R -c /path/to/source /path/to/dest
That's it. You get a copy that only stores additional space for metadata, not the files themselves.Also, it’s not really CoW. The immutable object store is hardlinked (since it’s immutable it doesn’t really CoW, but that’s not a very important distinction). But working files are full copies, and so is the rest of .git. With a CoW filesystem you can CoW everything, including node_modules and build artifacts.
NAME
clonefile – create copy on write clones of files
SYNOPSIS
...
LIMITATIONS
Cloning directories with these functions is strongly discouraged. Use copyfile(3) to clone directories instead.
But no explanation of why strongly discouraged.