15

I am using tortoise SVN for a project that I'm working alone and I have committed (by mistake) a huge file to my repository (a VC++ Intellisense Database). Now I want to remove this file from my repository to facilitate its backup.

Removing the file from my project and doing a commit (obviously) do not solve my problem as the previous version of that file are still there in the repository. Is there a way to solve this problem that does not involve the creation of a new repository?


EDIT

The @ryansstack solution worked perfectly, that is what I did (I ran the commands in the directory where my repository was located):

First I created a dump of my repository filtering that huge file:

svnadmin dump tcc | svndumpfilter exclude "/trunk/Image Segmentation/Image Segmentation.ncb"  > tcc.bak

Then I have created a new repository (tcc2) and ran the following command:

svnadmin load tcc2 < tcc.bak

Now the dump size of tcc2 is 7 MB versus 170 MB of tcc.

1

5 Answers 5

23

http://subversion.apache.org/faq.html#removal

you can't, quickly, but there is a way

0
3

I've looked at doing something similar, and fundamentally Subversion is set up so that you can't simply delete something like that.

But since you are already backing up the database, you should check this out. What I ended up doing was dumping my repository, filtering it, and then loading it into a new repository. Of course, I was already doing the dump / filter / load cycle for other reasons, so a little bit of extra filtering didn't add much work. If you're already doing a backup, you can backup your current repo (I assume you're doing a dump, or multiple incremental dumps for that), filter that particular revision out using svndumpfilter, and reload from the backup.

EDIT: Tigris officially has an issue 516 on this. The "svn obliterate" command is planned, but it isn't implemented yet.

2

As far as I know, once a file is committed in svn, there is no functionality in svn for undoing that. You can remove the file from the directory and commit the directory, but that will only make the file not being part of the latest revision of the directory; the committed revision is still in there. Usually I find that a good thing, but of course there are cases (like yours) where it may be less desirable.

-1

We ran into the same problem. My SVN server admin tells me this cannot be done. The only way you can do it is start a new repository and archive the old one to disk or whatever.

Don't make any changes to the file, esp. if it's a binary file, because then I believe SVN stores multiple copies of it.

1
  • SVN does diffs of binary files. Commented Jul 23, 2009 at 12:26
-1

it is not possible to undo a committed file from svn.

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