Subversion hosting, CVS hosting, Bugzilla hosting and software collaboration Providing hosted Subversion, CVS and Bugzilla repositories

Ask The Source

Go To My Account
Bugbox Icon


This month's question - Last Day of Summer 2006

Q: Hi Greg,

How do I permanently remove files and/or directories from my Subversion repository?

A: The svndumpfilter tool in combination with svnadmin dump and svnadmin load will do what you want.

For example, let's say that you recently converted a CVS repository into a Subversion repository using the cvs2svn script. Part of a standard CVS repository is the "CVSROOT" module where the CVS administrative files are stored.

After the conversion, you discover that the CVSROOT module has been placed in your Subversion repository, and it is no longer needed. In order to permanently remove it from the repository, the following commands are used:

svnadmin dump /SVNrepos --incremental > /tmp/SVNrepos.dump

cat /tmp/SVNrepos.dump | svndumpfilter exclude /trunk/CVSROOT --drop-empty-revs --renumber-revs > /tmp/SVNrepos_filtered.dump

mv /SVNrepos /SVNrepos.orig

svnadmin create /SVNrepos

cat /tmp/SVNrepos_filtered.dump | svnadmin load /SVNrepos

At the end of this sequence of commands, the old Subversion repository is still located in /SVNrepos.orig, and the new repository is located at /SVNrepos.

It's also useful to note that multiple "exclude" and "include" subcommands can be passed on the svndumpfilter command line, if you have a more complex filtering operation in mind.

Full details about the svndumpfilter tool can be found here.

Ask the Source is a regular feature of the email newsletter,

Do you have a question for The Source? Submit one today, and we'll review it for inclusion in a future edition of!

For a complete list of all "Ask The Source" questions and answers, please visit the archives page.



News (more...)

Articles (more...)

Sign up for or view archives




hosted solutions | pro servs | company | sales | support | resources
home | contact | client login

Copyright © 1999-2019, LLC. All Rights Reserved.
usage agreement | policies