forum/Create lightweight checkouts on the same filesystemgit-annexhttp://git-annex.branchable.com/forum/Create_lightweight_checkouts_on_the_same_filesystem/git-annexikiwiki2017-10-02T16:43:08Zcomment 1http://git-annex.branchable.com/forum/Create_lightweight_checkouts_on_the_same_filesystem/comment_1_dc219eec54b62803831c854a620aceae/stephane-gourichon-lpad2017-07-20T17:47:42Z2017-07-20T17:47:42Z
<p>Symbolic links point to <code>......./.git/annex/objects/.....</code></p>
<p>So, you can have them work by making your <code>.git/annex/objects</code> a link to the main repo's <code>.git/annex/objects</code>.</p>
<pre><code>cd $mylightweightclone/.git/annex
mv objects objects.empty # move away but keep, just in case
ln -s $centralrepository/.git/annex/objects
</code></pre>
<p>If the lightweight clone only performs read operations, I would expect things to work fine.</p>
<p>I don't know if it can be dangerous to the health of your central repository besides that, so be careful.</p>
comment 2http://git-annex.branchable.com/forum/Create_lightweight_checkouts_on_the_same_filesystem/comment_2_1263830d015a458024a2346540f10f31/joey2017-10-02T16:43:08Z2017-10-02T16:40:44Z
<p>The way to do this is to use <code>git clone --shared</code>.
Since git-annex version, 5.20140915, it detects when a new
repository has been cloned that way and enables annex.hardlink,
so files are inexpensively linked into place in the clone when getting them
from the origin on the same filesystem.</p>