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

Re: "git gc" doesn't seem to remove loose objects any more

From
Mark Brown <broonie@sirena.org.uk>
Date
Dec 15, 2008, 16:12 UTC
Message-ID
<20081215161212.GE31145@sirena.org.uk>
In-Reply-To
<20081215155610.GA11502@mit.edu>
On Mon, Dec 15, 2008 at 10:56:10AM -0500, Theodore Tso wrote:
> On Mon, Dec 15, 2008 at 03:08:34PM +0100, Bj?rn Steinbrink wrote:
> > To clarify that a bit more: git gc keeps unreachable objects unpacked,
> > so that git prune can drop them. And git gc invokes git prune so that
> > only unreachable objects older than 2 weeks are dropped.
Show 7 quoted lines
> To be even more explicit, "git gc" will **unpack** objects that have
> become unreachable and were currently in packs.  As a result, the
> amount of disk space used by a git repository can actually go **up**
> dramatically after a "git gc" operation, which could be surprising for
> someone who is running close to full on their filesystem, deletes a
> number of branches from a tracking repository, and then does a "git
> gc" may get a very unpleasant surprise.

It can also cause things like the "please repack" warning in git gui to go off. This is especially unhelpful since they tend to tell you to go and do a gc to resolve the problem.

Previous: Theodore TsoNext: Johan Herland
Message 6 of 12 in “"git gc" doesn't seem to remove loose objects any more”
  1. Bruce StephensDec 15, 2008
  2. Mikael MagnussonDec 15, 2008
  3. Bruce StephensDec 15, 2008
  4. Björn SteinbrinkDec 15, 2008
  5. Theodore TsoDec 15, 2008
  6. Mark BrownDec 15, 2008
  7. Johan HerlandDec 15, 2008
  8. Mikael MagnussonDec 15, 2008
  9. Jakub NarebskiDec 15, 2008
  10. Theodore TsoDec 15, 2008
  11. Brandon CaseyDec 15, 2008
  12. objects to be pruned immediately don't have to be loosenedNicolas Pitre, Dec 15, 2008

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.