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

git gc can require using a *huge* amount of space

From
Theodore Ts'o <tytso@mit.edu>
Date
Sep 1, 2008, 01:22 UTC
Message-ID
<E1KZy7W-00023U-UN@closure.thunk.org>

One of the things which I noticed which can be a bit of a misfeature is if you are trying to save disk space by running "git gc", it can sometimes take *substantially* more disk space. For example, I ran "git reflog --all --expire=0 --expire-unreachable=0" on a repository that had linux-next as one of its remotes. Before I ran "git gc --prune" the repository was packed, and its .git/objects was a bit over 50 megs (there was an alternates file). While I was running the "git gc", it was busy ejecting all of the objects that were no longer reachable separate files, and the size of .git/objects ballooned to over 200 megs, before settling in at 150 megs or so after "git gc" completed. After I ran "git prune", the size of .git/objects shrank back down to 48 megs.

That kind of swing in disk usage seems a bit excessive.... maybe instead of pushing out all of the no-longer-reachable objects into separate files, they could be put in a separate pack file (which the user could then delete much more quickly than it would take "git prune" to run)?

     	     	      	   	       	     - Ted
Message 1 of 1 in “git gc can require using a *huge* amount of space”
  1. Theodore Ts'oSep 1, 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.