{"thread":{"id":"31927","subject":"Large number of object files","startedAt":"2012-10-24T05:21:11Z","lastAt":"2012-10-24T07:11:09Z","messageCount":3,"participants":["Uri Moszkowicz","Nguyen Thai Ngoc Duy","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"201788","messageId":"CAMJd5AS1=Cf--0=1Xynxf1J-22fxBq05XjNGMcUep+ndAOO7ig@mail.gmail.com","threadId":"31927","inReplyTo":null,"subject":"Large number of object files","fromName":"Uri Moszkowicz","fromEmail":"uri@4refs.com","sentAt":"2012-10-24T05:21:11Z","receivedAt":"2012-10-24T05:21:11Z","isPatch":false,"sender":{"key":"uri@4refs.com","avatar":null},"body":"Continuing to work on improving clone times, using \"git gc\n--aggressive\" has resulted in a large number of tags combining into a\nsingle file but now I have a large number of files in the objects\ndirectory - 131k for a ~2.7GB repository. Any way to reduce the number\nof these files to speed up clones?\n"},{"id":"201794","messageId":"CACsJy8CcMBJLV=urVoWOQABQzQkC6y35spPF+_3fW6dtJjHtvg@mail.gmail.com","threadId":"31927","inReplyTo":"CAMJd5AS1=Cf--0=1Xynxf1J-22fxBq05XjNGMcUep+ndAOO7ig@mail.gmail.com","subject":"Re: Large number of object files","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-24T06:59:16Z","receivedAt":"2012-10-24T06:59:16Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Oct 24, 2012 at 12:21 PM, Uri Moszkowicz <uri@4refs.com> wrote:\n> Continuing to work on improving clone times, using \"git gc\n> --aggressive\" has resulted in a large number of tags combining into a\n> single file but now I have a large number of files in the objects\n> directory - 131k for a ~2.7GB repository.\n\nCan you paste \"git count-objects -v\"? I'm curious why gc keeps so many\nloose objects around.\n\n> Any way to reduce the number of these files to speed up clones?\n\nAn easy way to get rid of them is to clone the non-local way.\nEverything will be sent over a pack, the result would be a single pack\nin new repo. Try \"git clone file:///path/to/source/repo new-repo\". You\ncan also try \"git prune\" on the existing repo (read its man page\nbefore use).\n-- \nDuy\n"},{"id":"201796","messageId":"20121024071109.GB29403@sigill.intra.peff.net","threadId":"31927","inReplyTo":"CACsJy8CcMBJLV=urVoWOQABQzQkC6y35spPF+_3fW6dtJjHtvg@mail.gmail.com","subject":"Re: Large number of object files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-10-24T07:11:09Z","receivedAt":"2012-10-24T07:11:09Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 24, 2012 at 01:59:16PM +0700, Nguyen Thai Ngoc Duy wrote:\n\n> On Wed, Oct 24, 2012 at 12:21 PM, Uri Moszkowicz <uri@4refs.com> wrote:\n> > Continuing to work on improving clone times, using \"git gc\n> > --aggressive\" has resulted in a large number of tags combining into a\n> > single file but now I have a large number of files in the objects\n> > directory - 131k for a ~2.7GB repository.\n> \n> Can you paste \"git count-objects -v\"? I'm curious why gc keeps so many\n> loose objects around.\n\nPresumably ejected from the pack because they are now unreachable.\nThat's a rather large number, but if there was recent ref maintenance\n(e.g., deleting branches or tags), it is not impossible.\n\n> > Any way to reduce the number of these files to speed up clones?\n> \n> An easy way to get rid of them is to clone the non-local way.\n> Everything will be sent over a pack, the result would be a single pack\n> in new repo. Try \"git clone file:///path/to/source/repo new-repo\".\n\nIf you have git v1.7.12 or greater, you can also use the \"--no-local\"\noption to clone. But as you mentioned, pruning is probably the most\nsensible thing (and for a non-local clone, those objects should not\nimpact performance at all, as we will never even look at unreferenced\nobjects).\n\n-Peff\n"}]}