How to get rid of big binary files buried in my repository's history

Douglas Philips dgou at mac.com
Wed Feb 25 00:42:11 CST 2009


> I very much don't like this situation, but how can I truly get rid  
> of the file? If I simply remove it, it remains part of a past  
> changeset, so every time I make a new clone of the repository it  
> will need to be downloaded again (twice in my case). If I update  
> back to a revision before I added the file I lose all my changes  
> that followed, and I cannot see how I could merge these changes back  
> in without merging back in the video file as well.
>
> Any help would be greatly appreciated!

You might want to use Mercurial's ability to "convert" from a  
Mercurial repo to another Mercurial repo and filter out files in the  
process.
That will change all your changeset hashes of course, but should  
otherwise leave your history intact.
See http://www.selenic.com/mercurial/wiki/index.cgi/ConvertExtension  
and search for filter (and for Hg -> Hg conversion near the bottom of  
the page).
The beauty is that you'll get a new repo and you can then look at it  
to make sure it has the structure/tags/etc. etc. that you want before  
you decide if you want to keep it or not.

Hmmm, this should probably be added to the generic FAQ page, I'll try  
to get to that tomorrow if someone else doesn't beat me to it.

-Doug



More information about the Mercurial mailing list