In fact, git-unpack-objects will work fine if you first rename or move the package file. It is intended to add an incoming package to the repository, adding all objects that do not yet exist. Just move the package file to the file name where git cannot find it, will make all its objects irreplaceable.
Basically:
mv .git/objects/pack .git/objects/pack.old
for i in .git/objects/pack.old/pack-*.pack; do
git-unpack-objects < $i && rm $i ${i%pack}idx
done
rmdir .git/objects/pack.old
, , ( - ), Linus , ( rsync), , .
- ( ), .keep ( $i pack-*.pack, touch ${i%pack}keep). "", .
rsync "" , , , .keep shunk.
- git-bundle , .