Remove a file or folder from a SVN repository

At the moment I'm writing some Rails applications and Subversion or GIT are the defacto standard when it comes to Rails. Have not used it that much before and for one of the applications I realized I had by accident put both a /tmp and /log folder under version control as well a file with secret keys. The /tmp and /log files could have easily been removed with "svn delete" followed by a commit but for the file with the keys these secret keys would still be in the repository database which might be a security issue. Here is how to remove these files and folders, as described in the SVN FAQ -> "svnadmin dump your repository, then pipe the dumpfile through svndumpfilter (excluding the bad path) into an svnadmin load command".
sudo svnadmin dump /home/svn/projectada >  ~/full.dump
svndumpfilter exclude trunk/secure trunk/log trunk/tmp < full.dump >cleaned.dump
sudo rm -r /home/svn/projectada
sudo svnadmin create /home/svn/projectada
sudo svnadmin load /home/svn/projectada < ~/cleaned.dump

Tags: ,

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may quote other posts using [quote] tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options