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

Re: Confused about `git gc`

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 9, 2009, 10:45 UTC
Message-ID
<m3ljo14r61.fsf@localhost.localdomain>
In-Reply-To
<4A2E1D37.9010909@ubicom.com>
Yakup Akbay <yakbay@ubicom.com> writes:
Show 8 quoted lines
> Looks like I didn't quite understand the actual role of `git gc`. I
> just thought that `git gc` would remove all unreferenced objects
> during the unpack-pack process. However, I'm not seeing the result
> what I was expecting from `git gc`.
> 
> I'm adding an object into the database, which is ignored by git. Then
> I expect the object to be removed after `git gc`. But, it's still
> there.
[...]
> What am I overlooking?

You are probably overlooking the safety introduced to "git gc" to make it safer against concurrently run git operations, namely the fact that it would not remove new loose objects (it would remove loose objects only when they are old enough).

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Yakup AkbayNext: Yakup Akbay
Message 2 of 3 in “Confused about `git gc`”
  1. Yakup AkbayJun 9, 2009
  2. Jakub NarebskiJun 9, 2009
  3. Yakup AkbayJun 9, 2009

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.