views:

446

answers:

4

I just got through manually removing the bin\ and obj\ folders from around 30 VS projects getting them ready for an initial SVN commit. Yeah, I know, I should have done it alot sooner, but these are personal project on my home PC, and I only installed a SVN server locally today.

Anyway, it occurs to me that there must be some easier way to clean out these folders, an option in Visual Studio, or an external tool, something... Does anyone have any suggestions, since I still have a few solutions left to do?

+4  A: 

You can use svn:ignore to avoid committing unnecessary files...

CMS
Ah... Didn't notice that in the TortoiseSVN config... I'd assume these setting apply on imports too, not just commits?
Matthew Scharley
Yes, you can also use the Global Ignore list... http://tinyurl.com/3sd988
CMS
A: 

VisualSVN automatically creates svn:ignore rules for binary and user-specific folders, as soon as you add a solution to Subversion.

X-Cubed
I'm using TortoiseSVN and AnkhSVN, I don't know about Ankh, I'm using Tortoise to set this up, but Tortoise only allows ignoring files that aren't already commited.
Matthew Scharley
A: 

What happens when you do a "clean" on your solution or project files? You could do a clean before adding your project files to SVN.

Another thing you could try is to add exclusion rules to your SVN repository.

You could even create a new build target (call it "SVN Prep" for instance) that does nothing but run a post-build task that clears your files via a batch file or Windows script.

A method I sometimes apply is to use an advanced file manager like Total Commander to manually delete the files with just a few steps. I "explode" all the folders to see all the files in a flat view (CTRL-B), sort the files by extension and then delete all the build artifacts.

Ates Goral
A: 

A non-SVN specific option that can be applied to a few more situations is to use WinRar. Create a zip of your project structure, and then one of the menu options is to view the archive in 'flat folders' view. This removes the hierarchy and shows all of the files.

This can be useful in a number of ways, such as sharing files with coworkers. You can sort the files by type, look up all the .dlls and remove all of the common libraries you use to reduce the size. Or you can sort by date, and remove all .cs files that have not been changed in the last week, etc.

Travis