month's question - Last Day of Summer 2006
Q: Hi Greg,
How do I permanently remove files and/or directories from my Subversion
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
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 SourceHosting.net
email newsletter, SourceHosting.news.
Do you have
for The Source? Submit
one today, and we'll
review it for inclusion in a future edition of SourceHosting.news!
For a complete list of all "Ask The Source"
questions and answers, please visit the archives