Suppose you do that to repos A and B. Now, in A, you git annex drop a file that is only present in those repositories. A checks B to make sure it still has a copy of the file. It sees the (same) file there, so assumes it's safe to drop. The file is removed from A, also removing it from B, and losing data.
It is possible to configure A and B to mutually distrust one-another and avoid this problem, but there will be other problems too.
Instead, git-annex supports using cp --reflink=auto, which on filesystems supporting Copy On Write (eg, btrfs), avoids duplicating contents when A and B are on the same filesystem.
Yes, there's another option since git-annex version 5.20140915.
annex.hardlink can be set to true, and then git annex get will
simply hardlink the files into place.
Note the caution about using this option:
Use with caution -- This can invalidate numcopies counting,
since with hard links, fewer copies of a file can exist. So, it
is a good idea to mark a repository using this setting as
untrusted.
And, there's a nice easy way to set up local clone that is configured this way:
When a repository is set up using git clone --shared, git-annex
init will automatically set annex.hardlink and mark the reposiā
tory as untrusted.
I'm always impressed that when I Google for how to do some very specific thing with git-annex, there's typically already an easy to use option that does exactly that. The default behavior when a git repo is cloned with --shared is excellent user experience, and precisely matches my intuition for how it should behave.
Suppose you do that to repos A and B. Now, in A, you
git annex drop
a file that is only present in those repositories. A checks B to make sure it still has a copy of the file. It sees the (same) file there, so assumes it's safe to drop. The file is removed from A, also removing it from B, and losing data.It is possible to configure A and B to mutually distrust one-another and avoid this problem, but there will be other problems too.
Instead, git-annex supports using
cp --reflink=auto
, which on filesystems supporting Copy On Write (eg, btrfs), avoids duplicating contents when A and B are on the same filesystem.Yes, there's another option since git-annex version 5.20140915.
annex.hardlink can be set to true, and then
git annex get
will simply hardlink the files into place.Note the caution about using this option:
And, there's a nice easy way to set up local clone that is configured this way: