forum/manual update of .git/annex/objectsgit-annexhttp://git-annex.branchable.com/forum/manual_update_of_.git__47__annex__47__objects/git-annexikiwiki2014-03-26T19:09:07Zcomment 1http://git-annex.branchable.com/forum/manual_update_of_.git__47__annex__47__objects/comment_1_ea6ec91150c8962e2711631f2422bf3a/joeyh.name2013-11-27T22:47:37Z2013-09-12T17:11:41Z
<p>I do not recommend manually messing with the contents of .git/annex/objects. It is a good way to lose data.</p>
<p>If you look at the documentation for fsck in git-annex's man page, you will find the answer to your question.</p>
But how to clean this folder?http://git-annex.branchable.com/forum/manual_update_of_.git__47__annex__47__objects/comment_2_a7bbf304b26650a786e358bdc01e3069/rasmus2014-03-20T21:55:26Z2014-03-20T21:55:26Z
<p>Joey,</p>
<p>I have sometimes experienced that there is way too much content in the <code>.git/annex/objects</code> folder. For instance, my terminal emulator recently crashed during a sync which seemed to create a lot of folders.</p>
<p>In the annex repo where this happened I now got way too many folders (annex sometimes complain about no. of inodes or something like that) and I don't know how to clean it correctly.</p>
<p>Here's a "screenshot":</p>
<pre><code>[doc.annex] $ ls -a
. .. documents .git .gitignore
[doc.annex] $ find . -type d | wc -l
38568
[doc.annex] $ git annex fsck > /dev/null 2>&1
[doc.annex] $ find . -type d | wc -l
38568
[doc.annex] $ git annex repair > /dev/null 2>&1
[doc.annex] $ find . -type d | wc -l
38568
[doc.annex] $ find documents -type d | wc -l
1513
[doc.annex] $ find .git/annex/objects -type d | wc -l
36712
</code></pre>
<p>This is a <code>direct</code>-mode repo. With <code>.git/objectcts</code> I can use <code>git gc</code>. How can I tell annex to tidy up? I have tried <code>fsck</code>, <code>repair</code> and <code>forget</code>.</p>
<p>Any hints on how to deal with this? Other than manually clean up by deleting <code>.git/annex/objects</code> and rerunning <code>fsck</code>?</p>
comment 3http://git-annex.branchable.com/forum/manual_update_of_.git__47__annex__47__objects/comment_3_a855096b683c4c4f84e72c797e065d59/joeyh.name2014-03-26T19:09:07Z2014-03-26T19:09:07Z
<ol>
<li>This followup question seems to have nothing to do with the original question. (The aswer to the original question was <code>git annex fsck --fast</code>.)</li>
<li>I find it hard to believe that a crashing terminal emulator will create a lot of folders.</li>
<li>You show 36k subdirectories in .git/annex/objects. If I make a <em>tiny</em> 100 mb ext2 filesystem, it has 26k inodes. A 200 mb filesystem has 50k. So we're talking about a number of directories that is only large when using hardware from 1996.</li>
</ol>
<p>I'm not convinced yet that anything is wrong, or that there's anything you can do to improve matters. In any case, see <span class="createlink"><a href="http://git-annex.branchable.com/ikiwiki.cgi?do=create&from=forum%2Fmanual_update_of_.git__47__annex__47__objects%2Fcomment_3_a855096b683c4c4f84e72c797e065d59&page=todo%2Fwishlist__58___pack_metadata_in_direct_mode" rel="nofollow">?</a>wishlist: pack metadata in direct mode</span>.</p>