logoalt Hacker News

_fluxtoday at 9:45 AM1 replyview on HN

How about cp --reflink? Supported by btrfs, bcachefs and zfs. It's quite not as fast as subvolumes in btrfs, but it should be plenty fast.

This should actually be a feature for git itself, if it's not already.


Replies

gucci-on-fleektoday at 9:57 AM

That reflinks the files, which should get you the space savings, but I'm pretty sure that that still has to recursively copy every file in the directory, which can be fairly slow if you have tens of thousands of files, whereas btrfs snapshots can reflink the directory itself, so it should be faster.

Buy yeah, this should be equivalent in most cases, since I can't imagine that many Git repos have enough files for the difference to be noticeable.

show 1 reply