Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove all traces of a file from Subversion?

Tags:

svn

Is it possible to remove a file, with all version history, from SVN? For instance if you add a file with confidential financial information simply to have it backed up, and then realise it's in a SVN sub-directory all your developers can see...

like image 347
Mr. Boy Avatar asked Feb 12 '10 13:02

Mr. Boy


People also ask

How remove checked out folder from svn?

Use TortoiseSVN → Delete to remove files or folders from Subversion. When you TortoiseSVN → Delete a file or folder, it is removed from your working copy immediately as well as being marked for deletion in the repository on next commit.

How do I delete a Subversion revision?

Right-Click the revision you want to remove NOTE: this is the revision you want to remove, not the one you want to revert to. Select "Revert changes from this revision". Click "Yes" at the prompt. Update the checkout as normal, but to "HEAD".

What will happen if some versioned file or directory is removed from working copy by svn delete command?

Using svn to delete a file from your working copy deletes your local copy of the file, but it merely schedules the file to be deleted from the repository. When you commit, the file is deleted in the repository.


2 Answers

Yes, but it's not easy. You must be an administrator on the server where the Subversion server is running. Then use svnadmin dump to dump the repository, and svndumpfilter to exclude the appropriate file, and then reconstitute the repository. This is a costly and expensive operation which will take a long time for large repositories.

See the Subversion FAQ for more details. A detailed example of how to do this is also given in the Subversion book.

like image 111
John Feminella Avatar answered Nov 02 '22 01:11

John Feminella


As already mentioned, this is going to require dumping and filtering. However there a few gotchas here which can make it painful (i.e. if the file has moved or paths changed). I just went through a very similar process and documented it carefully here: http://www.troyhunt.com/2009/12/black-art-of-splitting-subversion.html

like image 26
Troy Hunt Avatar answered Nov 02 '22 01:11

Troy Hunt