Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to erase a file from an svn repository?

Tags:

svn

When files are deleted from as svn repository, they can still be accessed by users checking out old revisions. This is obviously one of the great advantages of source control.

Is it possible to erase a file from the repository? I am aware that this would compromise the integrity of past revisions containing the file.

For example, proprietary code might get inadvertantly committed to the public svn repository of an open source project. Is there any supported way of removing it from the repository so it cannot be retrieved, even by looking back at past revisions?

like image 921
ctford Avatar asked Dec 15 '09 15:12

ctford


1 Answers

http://subversion.tigris.org/faq.html#removal

There are special cases where you might want to destroy all evidence of a file or commit. (Perhaps somebody accidentally committed a confidential document.) This isn't so easy, because Subversion is deliberately designed to never lose information. Revisions are immutable trees which build upon one another. Removing a revision from history would cause a domino effect, creating chaos in all subsequent revisions and possibly invalidating all working copies.

The project has plans, however, to someday implement an svnadmin obliterate command which would accomplish the task of permanently deleting information. (See issue 516.)

In the meantime, your only recourse is to svnadmin dump your repository, then pipe the dumpfile through svndumpfilter (excluding the bad path) into an svnadmin load command. See chapter 5 of the Subversion book for details about this.

like image 76
miku Avatar answered Oct 27 '22 00:10

miku