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

Best way to optimize a git repository?

From
Sskillzero@gmail.com <skillzero@gmail.com>
Date
May 3, 2008, 00:34 UTC
Message-ID
<2729632a0805021734h72196639x8789a00ce9be4059@mail.gmail.com>

I want to periodically optimize my repositories even if it takes a long time to run the command. Should I do 'git gc --aggressive', 'git repack -a -d', 'git prune', or some combination? The documentation implies that things like git gc will use git repack, but I'm sort of looking for the definitive answer of what I should run to fully optimize my repositories. These are relatively new repositories, all created with git 1.5.5.1.

I also read somewhere (but can't find now) that some of these commands shouldn't be run while other people might be accessing the repository. I want to run these commands on a server that multiple people clone and pull from and push to. Is that safe to do? I'm okay if clone, pull, or push fail during this time (although I'd prefer if they didn't fail), I just don't want to corrupt the repository.

Next: Stephen R. van den Berg
Message 1 of 2 in “Best way to optimize a git repository?”
  1. skillzero@gmail.comMay 3, 2008
  2. Stephen R. van den BergMay 3, 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.