Versioning: Follow Conversions with Repack

February 09, 2011

In the last post, I covered the process of moving from hg to git. It was a relatively smooth conversion, but upon pushing my app to GitHub, I discovered a problem.

My 186-commit Mercurial repository had grown from a lean 12.5 megabytes to an unwieldy 300 megabytes; a staggering 2400% increase.

It’s worth mentioning Mercurial is usually tracking file deltas while Git is saving whole files, but something still felt wrong. This is a Ruby/JavaScript project, so there certainly weren’t any binary files in this repository.

Help came in the form of the generous Derek Hammer, friend of the blog and seasoned gitarist. After roughly 20 minutes of fiddling, the repack command was all that was needed to compress my new git repository down to 19.5 megabytes:

$ git repack -AdF

Possible Coined Term gitarist


Profile picture

Written by @sghill, who works on build, automated change, and continuous integration systems.