{"thread":{"id":"19217","subject":"git repack with a --reference","startedAt":"2009-05-07T04:21:44Z","lastAt":"2009-05-07T17:14:07Z","messageCount":3,"participants":["Jonathan Harker","Miles Bader","Brandon Casey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"113164","messageId":"4A0261D8.8040105@catalyst.net.nz","threadId":"19217","inReplyTo":null,"subject":"git repack with a --reference","fromName":"Jonathan Harker","fromEmail":"jonathan@catalyst.net.nz","sentAt":"2009-05-07T04:21:44Z","receivedAt":"2009-05-07T04:21:44Z","isPatch":false,"sender":{"key":"jonathan@catalyst.net.nz","avatar":null},"body":"Hi - hope this isn't too noobish but I'm trying to get an existing git\ncheckout to repack/prune/gc itself such that it would be like I had\ncloned it with --reference /path/to/local/repo (i.e. I've added\n/path/to/local/repo to .git/objects/info/alternatives, and I'd like it\nto reduce its objects from 200 MB to 5 MB). Is this\n\na. possible,\n\nb. desirable, and\n\nc. not insane?\n\nCheers,\nJonathan Harker\nhttp://catalyst.net.nz/\n"},{"id":"113168","messageId":"87bpq5bgle.fsf@catnip.gol.com","threadId":"19217","inReplyTo":"4A0261D8.8040105@catalyst.net.nz","subject":"Re: git repack with a --reference","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2009-05-07T05:57:17Z","receivedAt":"2009-05-07T05:57:17Z","isPatch":false,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"Jonathan Harker <jonathan@catalyst.net.nz> writes:\n> Hi - hope this isn't too noobish but I'm trying to get an existing git\n> checkout to repack/prune/gc itself such that it would be like I had\n> cloned it with --reference /path/to/local/repo (i.e. I've added\n> /path/to/local/repo to .git/objects/info/alternatives, and I'd like it\n> to reduce its objects from 200 MB to 5 MB). Is this\n>\n> a. possible,\n> b. desirable, and\n> c. not insane?\n\nI've done this in the past (using \"git gc\", but same difference I\nguess), and it worked as you'd hope, reducing .git to something very\nsmall.\n\nI don't recall any real problems, but you might need to manually\nremove any pack \".keep\" files first though (I seem to recall something\nlike that, anyway).\n\n-Miles\n\n-- \nFriendship, n. A ship big enough to carry two in fair weather, but only one\nin foul.\n"},{"id":"113236","messageId":"y6_KSeeksmCZ_XvwgBeZd4SDdo0CcdL0TgPJ6Py336qsFto6evR0vA@cipher.nrlssc.navy.mil","threadId":"19217","inReplyTo":"4A0261D8.8040105@catalyst.net.nz","subject":"Re: git repack with a --reference","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-05-07T17:14:07Z","receivedAt":"2009-05-07T17:14:07Z","isPatch":false,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Jonathan Harker wrote:\n> Hi - hope this isn't too noobish but I'm trying to get an existing git\n> checkout to repack/prune/gc itself such that it would be like I had\n> cloned it with --reference /path/to/local/repo (i.e. I've added\n> /path/to/local/repo to .git/objects/info/alternatives, and I'd like it\n> to reduce its objects from 200 MB to 5 MB). Is this\n> \n> a. possible,\n> \n> b. desirable, and\n> \n> c. not insane?\n\nyes,yes,yes.\n\nThe path written to .git/objects/info/alternates (also notice spelling of\n\"alternates\") should be the path to the objects directory, not to the\ntoplevel repository.\n\ni.e.\n\n   /path/to/local/repo.git/objects\n\nIt should work properly since git v1.6.2.3.\n\n-brandon\n"}]}