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

Re: Rewriting history with git-filter-branch and leaking objects (?)

From
David Kastrup <dak@gnu.org>
Date
Aug 17, 2007, 17:34 UTC
Message-ID
<86k5ruxdxz.fsf@lola.quinscape.zz>
In-Reply-To
<20070817171851.GB13891@glandium.org>
Mike Hommey <mh@glandium.org> writes:
Show 7 quoted lines
> I've been playing with git-filter-branch, and was wondering how objects
> from the original branch are supposed to be removed.
>
> It looks like removing the refs/original/* refs is not enough.
>
> And it also looks like when all references seem to be removed, git-prune
> doesn't fully do its job...

It is quite quite hard to get rid of objects. You need to get the reflogs for the commits and the files expired.

The last time I tried this, I ended up unpacking the packed objects, calling git-fsck with appropriate options to tell me about unreferenced objects when ignoring reflogs, and removing the files manually with xargs and rm.

Probably I was not able to do something reasonably intelligent, but making git actually _lose_ data/commits/whatever is really, really hard. I have messed up my repo structure considerably several times, and everything is still there, with the reflog telling you how to get it.

Given how easy it is to shoot oneself in the foot with git, it is not the worst thing. But you really have to work if you _mean_ it.

-- 
David Kastrup
Previous: Mike HommeyNext: Mike Hommey
Message 2 of 7 in “Rewriting history with git-filter-branch and leaking objects (?)”
  1. Mike HommeyAug 17, 2007
  2. David KastrupAug 17, 2007
  3. Mike HommeyAug 17, 2007
  4. Sam VilainAug 19, 2007
  5. Junio C HamanoAug 17, 2007
  6. Mike HommeyAug 17, 2007
  7. Mike HommeyAug 19, 2007

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.