{"thread":{"id":"31419","subject":"Automatic repacking when cloning - Only seems to work via file but not ssh or git","startedAt":"2012-09-03T23:20:48Z","lastAt":"2012-09-03T23:20:48Z","messageCount":1,"participants":["haasip satang"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"198271","messageId":"CAEz-yfibq5M=qTfoR5rkCyUJ=zC=VLSRcL+p618VXR-8td7d8Q@mail.gmail.com","threadId":"31419","inReplyTo":null,"subject":"Automatic repacking when cloning - Only seems to work via file but not ssh or git","fromName":"haasip satang","fromEmail":"haasip.satang@googlemail.com","sentAt":"2012-09-03T23:20:48Z","receivedAt":"2012-09-03T23:20:48Z","isPatch":false,"sender":{"key":"haasip.satang@googlemail.com","avatar":null},"body":"Hi all,\n\nI already posted this question in the git users groups\n(https://groups.google.com/forum/?fromgroups=#!topic/git-users/dguTJFrw5MI)\nbut was advised to better ask the experts in this list. So here we go:\n\nThe question is regarding the packs and the repacking of those during\ncloning. I'm migrating a big repository which after initial commit of\nall files contains only one pack file of 120MB in size (about 800\nextracted).\n\nOn this big repo I created various subtree branches (using git subtree\nsplit) so I can clone some of the folders individually (without\ngetting the whole big thing). The problem is, however, that all my\nsubtree branch clones seem to get a copy of the big 120MB pack (where\noften only 2MB will be extracted from it).\n\nAfter testing a little bit I figured that this only happens if I use\nssh or the git protocol to clone the repo. When using file:// to\nspecify the remote repository some repacking seems to happen\nautomatically and I end up with a new pack file for my clone that only\ncontains the stuff that is really needed for my branch (which\nobviously results in much smaller size).\n\nRunning the following commands on the clone created via ssh or git\nhelps removing the unnecessary overhead and repacks my repo creating a\nsmall pack, discarding the unneded stuff:\n\ngit pack-refs --prune\ngit reflog expire --all\ngit repack -a -d -f -l\n\nSo although that helps me getting a small clone via ssh I have some\nquestions / doubts:\n\n1. Is it \"as designed\" that the repacking only happens automatically\nwhen cloning using the file url or could it be a bug that it is not\nsupported for ssh and git native protocol?\n2. Is there already a way to achieve the repacking when cloning using\nssh or git protocol (as obviously I'd prefer to use those over file://\n)?\n3. Can I provide multiple pre-made packs for my different subtree\nbranches already on server side to make the cloning even faster and\navoid always having to repack when someone clones a subtree branch?\n\nThanks a lot,\nHaasip\n"}]}