Something I wish there was a better solution for. Perhaps there is a filesystem out there that supports CoW in a way that fits this usecase (XFS perhaps even), but I haven't looked into it.
The disadvantage of using hardlinks is that you can't hardlink between users (user is a property of the file, not of the link to the file), and there's always the danger that a write takes place through one of the links. Imho, that should really be solved at the filesystem level using a CoW scheme.
To me it sounds like you want simple snapshots and backups without the redundancy at the storage level.
So why don't use a filesystem which supports that natively, like ZFS or Btrfs?
Anyway, theoretically[0]:
> As you might know btrfs treats subvolumes as filesystems and hence the number of snapshots is indeed limited: namely by the size of files. According to the btrfs wiki the maximum filesize that can be reached is 2^64 byte == 16 EiB
But it seems practically you're hitting the mud at ~100 snapshots[1] but be sure to read the reply to that mail as it will depend on the use case and it might turn out to be fine way beyond that.
[0]: https://unix.stackexchange.com/questions/140360/practical-li...
*not the best data point I realise....
I'd recommend zfs snapshots - or for something a bit different, maybe nilfs2:
Hardlink is not CoW. Modify the file all your backup will change too.
edit: Local in this case means cloning inside one filesystem. Hardlinks cannot span filesystem boundaries of course.
You're probably not doing your ongoing work in the branch you are merging for release anyway, if you did you'd have solve any conflicts all over again when you switch clone.