Posted at

What is `Auto packing the repository for optimum performance.'

More than 5 years have passed since last update.

何か git-push をした時に Auto packing the repository for optimum performance. と言われた。日本語サイトをサッと見ても無いし、stackoverflow にあったので、メモ書き程度の翻訳。



原文: what does “Auto packing the repository for optimum performance mean”?


I'm having a problem with my git repo. For the last couple of days whenever i do a push to the server I get this "Auto packing the repository for optimum performance." message and it does not seem to go away and return the shell.

ここ最近、サーバへ git push した時に Auto packing the repository for optimum performance と表示されて、git-push の処理が終わってないように思うんだ。

I also tried checking out to a new branch and then doing a rebase on my previous branch and then did git gc to remove the unused history objects and then did a push but still this message appears. Please let me know what's going on with my repo.

試しで、新しいブランチを作って、前のバージョンのを rebase してきて、要らない履歴を git-gc 使って消して push をしてみたけど、相変わらず出るんだ。何がどうなってるのおせーて。


Short version: it means what it says, and if you just let it finish, all will be well.

簡潔に言うと: それは、ちゃんと処理は終わってるし、上手く行ってるよ。

During most operations which can potentially increase the number of loose (unpacked) objects in the repository (including pushes), Git invokes git gc --auto. If there are enough loose objects (by default, at least 6700), it will then invoke git repack -d -l to pack them. If there are too many separate packs, it will also repack them into one.

リポジトリに、もしかしたらunpackedなオブジェクトが溜まってきているから、Git が git gc --auto をしてくれ、と言ってきてるのが一番の理由。デフォルトだと 6700 個なんだが、ルーズオブジェクトが大量に溜まっているなら、git repack -d -l をしてくれと言ってる。もし、大量の分割されたパックがあるなら、一回ほど repack をすればいいよ。

A pack is a delta-compressed single file, containing a large number of objects. It's more efficient to store objects in packs, but it takes time to pack (compress) objects, so Git initially creates loose objects, then packs them in batches now and then, via automatic invocation of git gc --auto.

パックは一つのファイルを delta-compressed していて、大きな数値のオブジェクトとして収められている。パックにはストアオブジェクトがたくさんあるんだが、圧縮の時に時間がかかるので、Git ははじめにルーズオブジェクトを作成し、バッチ処理でパックされ、そしてその時に、git gc --auto が自動的に実行させる。

If you let Git finish repacking, this won't happen again for a while. It can indeed take a while, especially if you have a lot of large binary objects, but if it's triggering, then it's a sign that it will probably drastically reduce the amount of disk space taken by the repo. If you really don't want it to happen, you can change the config parameter If you increase it to something much larger than 6700, it will happen less frequently, but take longer when it does. If you decrease it, it'll still have to do your current repack, but subsequently it will happen more often and finish more quickly. If you set it to 0, it will disable automatic repacking.


See man git-gc (under --auto) and man git-config (under for more information.

詳しくは git-gcgit-config の man ページを見て。