Patrick Desjardins
Patrick Desjardins

Reputation: 140983

Remove a specific file from a Subversion repository?

I have a SVN repository that has stuff from Bin directory (.exe, .dll, .pdb). I would like to clean up the repository to erase those file and to prevent them to come back.

  1. How can I clean the repository (without going file by file, directory by directory)?
  2. How can I prevent to add these file? (In SVNTortoise I have added a Global ignore pattern to *.exe *.suo *.pdb /Debug/* but it doesn't seem to work fine.

Upvotes: 1

Views: 2749

Answers (3)

Mercer Traieste
Mercer Traieste

Reputation: 4678

You will need to delete and ignore those files. There isn't a direct way to do it, as the ignore property does not apply recursively down the directory paths.

  • make sure you have tortoisesvn installed
  • checkout the repository path you need to modify to a local folder
  • use a find tool to find files, like *.dll, inside the local svn copy
  • I recommend find in total commander, press alt-f7, specify a search criteria, search
  • once the search is done, press "feed to listbox"

total commander search

  • select all files with ctrl-a
  • right click (by default in total commander you need to do a long right click for the context menu)
  • select the option tortoisesvn -> delete and ignore list -> delete and ignore xx items by extension

tortoisesvn mass ignore http://img60.imageshack.us/img60/5207/20090716104211.png

  • the same can be done with directories

Now you've achieved:

  • in each selected path, the file extensions you've ignored, will be ignored
  • in the future, don't commit those files, ignore them

Upvotes: 6

jeroenh
jeroenh

Reputation: 26792

As the original question was in fact how to clean up the repository (and there may be valid reasons to do so: legal, or repository size blowing up), I would like to add that the only way this can be done is by dumping a repository to a file (svn dump), filtering the contents with 'svndumpfilter' and reloading it into a new repository:

Upvotes: 2

segfault
segfault

Reputation: 5939

Those files weren't supposed to be in the repository. Only put in what you need to build the executable (source code + makefile).

I would suggest that you place the source and the executable in different directories, and only checkin those in the source directory.

For the deletion part, don't bother. Just create a new revision without those files.

Upvotes: 0

Related Questions