forum/Layout mismatch between symlinks and annex objectsgit-annexhttp://git-annex.branchable.com/forum/Layout_mismatch_between_symlinks_and_annex_objects/git-annexikiwiki2017-02-13T16:46:31Zcomment 1http://git-annex.branchable.com/forum/Layout_mismatch_between_symlinks_and_annex_objects/comment_1_854786810dc4246cdaa38ff10c55bbca/lealanko2015-09-06T13:11:44Z2015-09-06T13:11:44Z
<p>I think I figured it out: the repository was originally <a href="http://git-annex.branchable.com/bare_repositories/">bare</a>, and I converted it to non-bare manually. But that doesn't work, because bare annex repositories use <a href="http://git-annex.branchable.com/internals/hashing/">a different directory layout</a>.</p>
<p>I can understand why the hex-based layout is preferred (it's more portable), but deliberate incompatibility with the symlinks isn't very nice. I wish there was a way to upgrade the entire repository to a format that used the hex paths for symlinks, so bare and non-bare repositories used the same layout.</p>
comment 2http://git-annex.branchable.com/forum/Layout_mismatch_between_symlinks_and_annex_objects/comment_2_9134154ba2ef3575c39c7848136b79a9/joey2017-02-13T16:46:31Z2015-09-09T18:18:17Z
<p>I wish this incompatibility didn't exist either, but the transition to use
consistently 3 letter hash directories would be too much to ask of all the
users. And there are ways to convert a bare to non-bare that don't have
this problem, like making a clone and using <code>git annex move --all --from
origin</code></p>
<p>There's an easy way to finish your conversion from bare to non-bare.
Just move .git/annex/objects to old-objects, and run <code>git annex add
old-objects --backend=SHA256</code>. That will rename all the files into the right places for a
non-bare repository, so your existing symlinks will work. You can then
<code>rm -rf old-objects</code> to clean up.</p>
<p>Note that method assumes that SHA256 is the backend of everything in that
repo. If not, it gets a bit trickier; you'd need to use `git-annex
setkey'</p>