git to the resque – gimme back my bytes

Long time no blog – but I’ll make it short even so 🙂

Just a tip that might come in handy for those who haven’t found it out on their own

Before

[kmaraas@e4300 gtk+-2(gtk-2-24 *)]$ du -h

….

379M    .
[kmaraas@e4300 gtk+-2 (gtk-2-24 *)]$ git gc
Counting objects: 298483, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (50306/50306), done.
Writing objects: 100% (298483/298483), done.
Total 298483 (delta 252603), reused 293574 (delta 247802)
Checking connectivity: 298483, done.

[kmaraas@e4300 gtk+-2(gtk-2-24 *)]$ du -h

293M    .

That’s 90 MB for free…

 

2 thoughts on “git to the resque – gimme back my bytes”

  1. A word of caution. Garbage collecting in git is akin to emptying your desktop trash bin. If you truely don’t need the files then empty it. But if there’s a chance you want to recover some older data (e.g. roll back prior to a local rebase, amend, etc) then you might want to hang onto your garbage a bit longer.

Leave a Reply

Your email address will not be published. Required fields are marked *