{"thread":{"id":"46108","subject":"How do I regularly clean up .git/objects/pack/tmp_* files?","startedAt":"2017-06-03T20:53:25Z","lastAt":"2017-06-04T05:17:47Z","messageCount":2,"participants":["Dun Peal","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"321485","messageId":"CAD03jn5CEwZ0H+UKO4yW3PoL+XPXcwUGnehhv-KyBYQCYzAXGQ@mail.gmail.com","threadId":"46108","inReplyTo":null,"subject":"How do I regularly clean up .git/objects/pack/tmp_* files?","fromName":"Dun Peal","fromEmail":"dunpealer@gmail.com","sentAt":"2017-06-03T20:53:20Z","receivedAt":"2017-06-03T20:53:25Z","isPatch":false,"sender":{"key":"dunpealer@gmail.com","avatar":"https://gravatar.com/avatar/42f3e6a1166eb44e33f24c20ccbe809fa8591413f366dfe3755c8a8d4935ace9?d=mp&s=160"},"body":"Hi there,\n\nI try to follow the best practice of regular repo maintenance, which\nafaik consists of running `git gc` every week or so.\n\nSo I thought I had a well-maintained repository, and was quite\nsurprised to discover some very large .git/objects/pack/tmp_* files,\nwhich apparently are entirely needless and should be cleaned up, but\n`git gc` doesn't clean them.\n\nIs there another command I should regularly run, instead or in\naddition to `git gc`, to keep my repo well-maintained, and\nspecifically, to remove such unnecessary files from my .git directory?\n\nThanks, D.\n"},{"id":"321496","messageId":"20170604051740.gnkrjv35udgipg42@sigill.intra.peff.net","threadId":"46108","inReplyTo":"CAD03jn5CEwZ0H+UKO4yW3PoL+XPXcwUGnehhv-KyBYQCYzAXGQ@mail.gmail.com","subject":"Re: How do I regularly clean up .git/objects/pack/tmp_* files?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-06-04T05:17:40Z","receivedAt":"2017-06-04T05:17:47Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jun 03, 2017 at 04:53:20PM -0400, Dun Peal wrote:\n\n> I try to follow the best practice of regular repo maintenance, which\n> afaik consists of running `git gc` every week or so.\n> \n> So I thought I had a well-maintained repository, and was quite\n> surprised to discover some very large .git/objects/pack/tmp_* files,\n> which apparently are entirely needless and should be cleaned up, but\n> `git gc` doesn't clean them.\n> \n> Is there another command I should regularly run, instead or in\n> addition to `git gc`, to keep my repo well-maintained, and\n> specifically, to remove such unnecessary files from my .git directory?\n\nThey're kept with the same time-based grace period that is used for\nunreachable objects, which defaults to the rather conservative \"2\nweeks\". Try \"git gc --prune=1.hour.ago\".\n\n-Peff\n"}]}