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

Re: Are binary xdeltas only used if you use git-gc?

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Oct 31, 2008, 12:42 UTC
Message-ID
<vpqy705rl5u.fsf@bauges.imag.fr>
In-Reply-To
<f1d2d9ca0810310243r669840bbj2c5ee7183e0caaed@mail.gmail.com>
"Thanassis Tsiodras" <ttsiodras@gmail.com> writes:
> If that is the case, I will create an alias to always git-gc after commits...

If you have a decent version of git, it already does "git gc --auto" regularly. With --auto, git gc will do nothing if you don't have too many unpacked objects, and will try to do the right thing otherwise (incremental packs, see man git gc). The idea is that "git gc" is a costly operation, and git prefers to waste a bit of disk space to make most "commit" really fast, and to take time to optimize the repository only when it grew too much.

If you're worried about repository size and you have a permanently running machine, a good idea is to run git gc in a cron job, so that you work fast in daytime, and your computer optimizes hard at night time ;-) (I have gic gc + git fsck in a cron job, so I'll also know if a repository gets corrupted).

-- 
Matthieu
Previous: Jean-Luc HerrenNext: Thanassis Tsiodras
Message 22 of 23 in “Are binary xdeltas only used if you use git-gc?”
  1. Thanassis TsiodrasOct 31, 2008
  2. Pierre HabouzitOct 31, 2008
  3. Thanassis TsiodrasOct 31, 2008
  4. Nicolas PitreOct 31, 2008
  5. Nicolas PitreOct 31, 2008
  6. Jakub NarebskiOct 31, 2008
  7. Thanassis TsiodrasOct 31, 2008
  8. Jakub NarebskiOct 31, 2008
  9. Matthieu MoyOct 31, 2008
  10. Nicolas PitreOct 31, 2008
  11. Thanassis TsiodrasNov 1, 2008
  12. Nicolas PitreNov 1, 2008
  13. Thanassis TsiodrasNov 3, 2008
  14. Pieter de BieNov 3, 2008
  15. Nicolas PitreNov 3, 2008
  16. Thanassis TsiodrasNov 3, 2008
  17. Nicolas PitreNov 4, 2008
  18. Junio C HamanoNov 4, 2008
  19. Nicolas PitreNov 4, 2008
  20. Junio C HamanoNov 4, 2008
  21. Jean-Luc HerrenOct 31, 2008
  22. Matthieu MoyOct 31, 2008
  23. Thanassis TsiodrasOct 31, 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.