Removing file history from repository

Teemu Likonen tlikonen at iki.fi
Tue Nov 25 16:35:08 GMT 2008


Enrique Ramirez (2008-11-25 09:18 -0400) wrote:

> Hi, I was wondering if there's a way to remove all the versioning
> information of a file in the repository. It seems that by mistake I've
> been versioning some temporary binary files that can get pretty big
> (well in relation to the rest of the repository, anyway).

A warning first: This means modifying the project's history and the
repository won't be technically the same anymore. If you modify the
history like this, everybody who is working with the repository needs to
drop the old one and switch to the modified version.

I'd do this with Git. First convert the Bazaar repository to Git with
"bzr fast-export" and "git fast-import". Then in the Git repository run
the command:

    git filter-branch --tree-filter 'rm path/filename' HEAD

The command will automatically run "rm path/filename" on every revision
and create a new branch history (the old one is kept too). Then convert
the new branch back to Bazaar with "git fast-export" and "bzr
fast-import".



More information about the bazaar mailing list