Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I accidentally committed a whole bunch of binary files using TortoiseSVN's "Add folder" option when I should have used simply "Create folder". I do not want these binary files in SVN because they hog lots of space on my HD and don't really benefit from versioning anyway. However I'm unsure how best to go about reverting this mess in such a way that will actually free up the memory used committing all those binary files. I can easily delete all the files and commit, but I'm not confident this will actually remove their associated data from SVN, especially from the revision in which they were added.

I looked in the SVN repository dir and found a gigantic file "db/revs/67" which I assume represents data for revision 67 in which these files were added. Can I simply delete that file, or will it cause problems for SVN? It seems I would need to delete or modify files elsewhere so SVN acts as if those revisions never existed?

share|improve this question

1 Answer 1

To safely, completely remove a revision from your SVN history, you need to export the repository with the revision removed, and then restore it from the dump file. To do so, run the following commands on a terminal or the Windows command prompt:

svnadmin dump /path/to/repo -r1:66 > svn.dump
ren /path/to/repo /path/to/backup
svnadmin create /path/to/repo
svnadmin load /path/to/repo < svn.dump

(On *nix systems, replace ren with mv.)

Once you're sure everything is okay in the new repository, you can delete the backup.

Consider using the svn:ignore property to prevent those files from being committed to the repository in the future. You can add files to the ignore list with TortoiseSVN by right-clicking on them, going to TortoiseSVN, and choosing Add to ignore list.

share|improve this answer
    
Thanks. I'm not very familiar with command prompt, can you clarify: 1) How do I get command prompt to recognize these commands? 2) Is each line a new command? 3) When do I specify where to put the copy, is that in the second line "path/to/backup"? –  Aaron Mar 17 '11 at 2:36
    
...in the meantime I've deleted /db/revs/67 and /db/revprops/67 and changed /db/current from "67 1h5 p" to "66 1h5 p" on a copy of the whole repo dir. It seems to have worked. –  Aaron Mar 17 '11 at 2:45
    
@Aaron: The Command Prompt in Windows can be found in Start > All Programs > Accessories. Each line is a new command (e.g. press Enter after each one.) From what I understand deleting the last revision shouldn't cause any problems but if it had been an earlier one your repository would have stopped working. –  Patches Mar 17 '11 at 3:04
    
Whenever I tried the svn commands it simply said "svnadmin is not a recognized command" or similar. I'm assuming I needed to navigate it to some svn executable somewhere but I couldn't figure that out. –  Aaron Mar 17 '11 at 3:27
    
@Aaron: Should be C:\Program Files\Subversion\bin (perhaps C:\Program Files (x86)\Subversion\bin on 64-bit Windows) but if it came with TortoiseSVN it might have put it somewhere different. You can look around your Program Files or Program Files (x86) folders to be sure. Switch to that directory with the cd command followed by a space with the path in quotes. –  Patches Mar 17 '11 at 4:19

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.