git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: delete deprecated refs to release disk space

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 13, 2011, 17:01 UTC
Message-ID
<CACBZZX5kBqM1eye40_Vw0W=8qnNsUQBVCE0q9JrixYomGPuZbg@mail.gmail.com>
In-Reply-To
<20111113151033.GD16065@external.screwed.box>
2011/11/13 Peter Vereshagin <peter@vereshagin.org>:
Show 17 quoted lines
> 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.

Previous: Peter VereshaginNext: Peter Vereshagin
Message 2 of 4 in “delete deprecated refs to release disk space”
  1. Peter VereshaginNov 13, 2011
  2. Ævar Arnfjörð BjarmasonNov 13, 2011
  3. Peter VereshaginNov 14, 2011
  4. Peter VereshaginNov 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.