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

Possible git bug when using filter-branch to remove large binaries

From
JZJuan Zanos <juan_zanos@talkhouse.com>
Date
Feb 15, 2009, 21:35 UTC
Message-ID
<34854909-55F5-4869-A7A6-0E179F2F7A44@talkhouse.com>
Hi Vger,

I'm trying to remove a directory of large binaries from a git repository There is a directory of 85M in a git repository of 92M. So the binaries are relatively massive and should never have been checked in in the first place. I've tried to use filter-branch to permanently remove those binaries. The directory successfully vanishes. However, the repository + working directory only goes from 216M down to 133M. That means the binaries were only removed from the working directory. The repository remains bloated. I've tried a handful of magic incantations using commands such as gc, prune, reflog expire --all, etc.. None of these have worked. In fact, after cloning the 133M (repo + working) and running gc the directory actually increased in size from 133M to 290M!

I'm not really sure I understand what's going on here. It sounds like the growth to 290M is a bug. If so I'm happy to provide the repo as a test case as well as the exact commands I use. On the other hand, I'm finding that the git API is complex enough that I could easily be doing something wrong or missing some command. In that case is there a simple set of commands I could use to remove a directory of really large binaries that never should have been checked in in the first place and reclaim the space ? I've checked pretty thoroughly on Google to find people who have successfully done this, but it seems mostly people have failed to actually reclaim space.

Cheers, Juan

Next: Thomas Rast
Message 1 of 2 in “Possible git bug when using filter-branch to remove large binaries”
  1. Juan ZanosFeb 15, 2009
  2. Thomas RastFeb 15, 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.