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?
Remove specific files from revision history
356 views Asked by Alex AtThere are 3 answers
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:
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.
Create an empty repository,
- 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.
You'll need to use
svndumpfilter
tool. The procedure involves dumping your repository, filtering (withsvndumpfilter
) your dumpfile, and reloading the results into a new repository. See this chapter in the SVNBook for details.