Does this work on Linux?
The script is POSIX and uses no BSD-only spelling, so the reflink path calls `cp --reflink=always` and reads free space through `df -k`. It has not been run on Linux. The probe measures what a copy actually consumed, so a filesystem it guesses wrong about refuses the clone rather than making a full copy of 13 GB.
The script is POSIX and uses no BSD-only spelling, so the reflink path calls
cp --reflink=always and reads free space through df -k. It has not been run
on Linux. The probe measures what a copy actually consumed, so a filesystem it
guesses wrong about refuses the clone rather than making a full copy of 13 GB.
Why not use a worktree?
Use one when the tracked files are all you need. A worktree shares one repository, which is why it costs almost nothing and why it carries almost nothing: no dependencies, no build output, no initialised submodules, and a branch that no second worktree may check out.
What happens on ext4?
It refuses and says why. ext4 has no way to share blocks between two files, so every copy would cost the full size.