From: Ævar Arnfjörð Bjarmason Date: Sun, 13 Nov 2011 17:01:18 GMT Subject: Re: delete deprecated refs to release disk space Message-ID: In-Reply-To: <20111113151033.GD16065@external.screwed.box> 2011/11/13 Peter Vereshagin : > Hello. > > I use git for sql database backups: > >    http://gitweb.vereshagin.org/endvance/blob_plain/HEAD:/endvance/README > > Am wondering if there is a way to remove the expired revisions? Following that > scenario: > >    https://gist.github.com/1362183 > > I think there should be the way to decrease the space that .git takes. Without > compression, of course. > > No problem if this involves the overwriting of the history like  filter-branch > does.  But filter-branch doesn't seem to be able to remove the old  info  from > repository based on expiration time, does it? What you're looking for is git-filter-branch + the graft facility. I can't remember the exact invocation, but you echo the sha1 of the commit you want to be the oldest commit to .git/info/grafts, then run git-filter-branch. You can use whatever you like to discover that sha1, e.g. keep N revisions (which might be committed once per day) around, or have some custom time limit etc.