views:

438

answers:

2

I was using TortoiseSVN for backing up some very large binary files, which I no longer need. I want to recover back this disk space from the repository. All these files/folders were maintained under a single project (working copy) in TortoiseSVN under a single directory.

How do I delete all the versioned files and information related to this project from the SVN Repository?

+4  A: 

You cannot do this from SVN itself. You basically have to dump and rebuild the whole repository to do this. There is no svn destroy command, per se. That is by design. It keeps your history intact pretty much no matter what.

This guy seems to be pretty mad about it, but I personally think that a user-accessible svn destroy or svn obliterate or whatever is pretty much an anti-feature of a SCC system!

http://blog.projectnibble.org/2008/03/01/subversion-obliterate-the-forgotten-feature/

Dave Markle
+1 I've successfully shrunk a repo with some reckless commits using history filtering.
spender
An obilterate feature would be very useful if you needed to remove sensitive information or large files that were accidently added. But, yeah, other than that I cannot think of many use cases where it would be appropriate.
Brian Gideon
@Brian: That's true, that is a totally legit use. And I choose to ignore it as a possibility until I get bit with this problem (oh, and with my luck, it'll be next week or so...)
Dave Markle
Brian: But the reasons you mention are pretty compelling by themselves! I am surprised to realize that I cannot obliterate from SVN! :-(
Ashwin
@Ashwin: You can (dump and rebuild), but it isn't easy. And that's by design. You don't want anyone to just remove something from your repository in a way that it will never be recoverable. In order to do so you need access to the server, admin rights, and probably a bit experience. I actually consider this a feature.
sbi
A: 

I suppose you could imagine an environment where a programmer wants to obliterate commits to cover up his responsibility for a mistake. Or perhaps a more commmon problem would be, a novice programmer obliterates something he shouldn't have through ignorance and now all history is lost, or even a competent experienced programmer makes a mistake. Those scenarios are good reasons to make obliteration hard or require special privileges.

But I've had a number of times when we've decided to restructure our repositories for one reason or another. If, say, we have one repository on server A and another on server B, and we decide to move a project from A to B, I would really like to obliterate it from A. Otherwise, six months from now someone might find the copy on A and not realize it is no longer current.

Especially when I was first learning SVN, I made a lot of bad decisions about how to organize branches and tags that I later wanted to rework. I really wanted to just obliterate the old structure and put it all back right. Again, to avoid confusing anyone who looks at the history.

Jay