Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created an SVN server long time back. I have been storing some binary files (doc files) along with codes. After every edit size increases because SVN saves a new copy of binary file. Now the svn is occupying a lot of space.

Q1. I want to delete all previous revision of the binary files, keeping previous revisions of my codes intact, how do I do that?

Q2. Also is there any setting in SVN where I can customize it? Like "for specific folder dont store more than 10 revisions".

share|improve this question
up vote 3 down vote accepted

The only way to destroy data in subversion is to dump the repository to a file; run it through svndumpfilter and load it back again. svndumpfilter only works on paths, not revisions, however, so for your purpose, I'd recommend svn exporting your binaries folder, before doing the following:

svnadmin dump <repo root> > file.dump     
cat file.dump | svndumpfilter  exclude <repo path containing binaries> > file-new.dump
svnadmincreate <new repo root>
svnadmin load <new repo root> < file-new.dump

This will leave you with a copy of your repository, including full history, but without the offending path; and you'll see empty revisions in the history where commits to those paths happened. (There are some options to svndumpfilter to remove those, but in most cases you probably want to preserve the revision numbering.)

As for automating this, You could use a post-commit hook to script this process, but it's massively time consuming on large repositories. You'd be better off simply not storing binaries in SVN at all, if you don't need the history for them.

share|improve this answer

i'm affraid you cant do it 'out of the box', what goes in is meant to stay. you can remove files by dumping the repository, filtering files and importing it again - but it's a pain.

check this discussions: 1, 2.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.