Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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

 
discard

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.