Remove specific files from revision history

365 views Asked by At

I am trying to remove specific files from the revision history that I did not mean to commit. Can someone provide a way to do this?

3

There are 3 answers

0
Mark On

You'll need to use svndumpfilter tool. The procedure involves dumping your repository, filtering (with svndumpfilter) your dumpfile, and reloading the results into a new repository. See this chapter in the SVNBook for details.

1
Daniel Moura On

You can't remove the revision history.

0
bahrep On

Besides the filtering repository dump with svndumpfilter there is another solution that allows you to get rid of specific files and folders in a repository. Please see the Apache Subversion FAQ entry "How do I completely remove a file from the repository's history?".

The solution requires you to perform the following steps:

  1. Setup path-based authorization rules to deny read access for a USERNAME to the PATHS of the file or a folder you want to remove from repository history. Please note the plural noun paths. The file or folder you want to get rid of could have different names or can be located in different places across a repository history. Please consider this when setting up deny rules.

  2. Create an empty repository,

  3. Use svnsync tool to synchronize the source (i.e. the original one) repository to the target repository under account USERNAME. For details on repository replication with svnsync please refer to SVNBook chapter "Repository Replication".

Unlike svndumpfilter, svnsync will automatically translate copy operations with an unreadable source path into normal additions, which is useful if history involving copy operations needs to be filtered.