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

Re: Is there a way to trim old SHAs from a git tree (so it's not so large)?

From
Shawn Pearce <spearce@spearce.org>
Date
Nov 15, 2006, 22:33 UTC
Message-ID
<20061115223300.GF24861@spearce.org>
In-Reply-To
<455B9411.4090708@freescale.com>
Timur Tabi <timur@freescale.com> wrote:
Show 10 quoted lines
> Shawn Pearce wrote:
> 
> >Have you tried "git repack -a -d" to repack the loose objects into
> >a pack file?  Doing this every so often should reduce your disk
> >space consumed by a HUGE amount.
> 
> Woah!  It shrunk that bad boy down to 420M!  That should do it, thanks!
> 
> I wonder why the powerpc tree shrank so much.  Do you think the maintainer 
> just needs to run git-repack on his tree?
Possible, yes.

However published repositories don't tend to repack as often as it makes things harder for people who clone/fetch over HTTP rather than the native git protocol.

The reason is that HTTP can fetch individual loose objects that you don't have yet, but if the object is only available in a pack file then you need to fetch the entire pack file. But you might already have most of that pack file, so now you are downloading lots of data you already have. :-(

Previous: Timur TabiNext: Thomas Kolejka
Message 4 of 19 in “Is there a way to trim old SHAs from a git tree (so it's not so large)?”
  1. Timur TabiNov 15, 2006
  2. Shawn PearceNov 15, 2006
  3. Timur TabiNov 15, 2006
  4. Shawn PearceNov 15, 2006
  5. Thomas KolejkaNov 17, 2006
  6. Timur TabiNov 21, 2006
  7. Shawn PearceNov 21, 2006
  8. Timur TabiNov 21, 2006
  9. Shawn PearceNov 21, 2006
  10. Timur TabiNov 21, 2006
  11. Shawn PearceNov 21, 2006
  12. Timur TabiNov 21, 2006
  13. Johannes SchindelinNov 21, 2006
  14. Timur TabiNov 21, 2006
  15. Jakub NarebskiNov 21, 2006
  16. Johannes SchindelinNov 21, 2006
  17. Timur TabiNov 21, 2006
  18. Jakub NarebskiNov 21, 2006
  19. Johannes SchindelinNov 21, 2006

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.