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

Re: git gc == git garbage-create from removed branch

From
HFHallvard Breien Furuseth <h.b.furuseth@usit.uio.no>
Date
May 4, 2012, 08:58 UTC
Message-ID
<7c72f0810ec9647a9835e87ad100b603@ulrik.uio.no>
In-Reply-To
<4FA38731.8010504@op5.se>
 On Fri, 04 May 2012 09:37:21 +0200, Andreas Ericsson <ae@op5.se> wrote:
Show 9 quoted lines
> On 05/03/2012 08:38 PM, Hallvard Breien Furuseth wrote:
>> After removing a branch, 'git gc' explodes all objects
>> which were only in that branch.  Git filled up my disk that
>> way when I had cherry-picked from a big remote repo and then
>> did git remote rm.  Tested with Git 1.7.10.1 and 1.7.1.
>
> That's by design. It's added to save people who accidentally
> delete a branch or for some other reason really want to keep the
> objects they're about to delete.
 Keeping old objects for a while is by design, which I appreciate.
 Consuming gigabytes of disk space for this is a design bug.  Git should
 pack such objects when they breed too fast, just like other objects.
 If that's a hard design issue to get around, git gc should at least
 catch this and stop unless the user forces gc with some option.
 Users should not need to know that in certain circumstances, gc will
 ravenously eat their disk space without even giving advance notice.
> Use 'git gc --prune=now' with a recent* git and you'll avoid the
> problem.
 I don't want to prune.  Old objects have indeed saved me from
 accidents, as you mention.
 But it's good to know I don't need to throw away the reflog too.
 Thanks.
 Hallvard
Previous: Andreas Ericsson
Message 3 of 3 in “git gc == git garbage-create from removed branch”
  1. Hallvard Breien FurusethMay 3, 2012
  2. Andreas EricssonMay 4, 2012
  3. Hallvard Breien FurusethMay 4, 2012

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.