views:

121

answers:

5

Hello,

I use subversion with TortoiseSVN on projects at work and my personal ones.

I was wondering what is considered best practice in terms of being able to setup your repo so that doing a SVN Checkout and VisualSVN for Visual Studio will get you all that you need to compile ... but I want to be able to mark certain files so that they will not be recommended for any SVN Commits. Ideally the file would no longer even be marked as changed (I'm anal like that).

The classic example of this would be an app.config that will have different connect strings for each developer machines.

Seth

A: 

Use a local svn:ignore http://sdesmedt.wordpress.com/2006/12/10/how-to-make-subversion-ignore-files-and-folders/

verhogen
svn:ignore wont ignore files already added to the repository.
Simon Svensson
A: 

What about having a app.config.example shared in the repository and svn:ignore the files you want to keep for yourself ?

Jouvent
+4  A: 

I usually commit a web.config.template and let the other developers copy this to web.config and do any changes they want. They can then select both their web.config and the web.config.template file and, using Tortoise (or any other similar functionality) show differences between the two files. This would show their local changes, and also any changes done to the template.

Simon Svensson
Add `web.config` to `svn:ignore` and you have a very nice, unobtrusive solution.
D.Shawley
Thanks for the tip. I gave Blu the answer flag but up-voted yours as well. Thanks for the tip. I use WinMerge to compare and merge differences.Very helpful.Seth
Seth Spearman
+4  A: 

The usual approach is to create a template file and commit that, then add the configuration file to svn:ignore. You could even go a step further and add a pre-compile step in Visual Studio that checks for the configuration file and, if not present, creates it from the template. Depending on the values to be set in the configuration this might or might not be a good idea.

bluebrother
A: 

If you're using Visual Studio, most (but not all) project systems support the "Exclude From Source Control" action. You won't find it on the context menu unfortunately. Have to select the file(s) in Solution Explorer, then File -> Source Control -> Exclude. From then on, the project/solution will not make any requests to the active source control provider upon editing/saving/etc (depending on your Tools -> Options -> SCC -> Environment settings).

Naturally this won't work if you leave VS and accidentally checkout/checkin the excluded file from Tortoise.

Richard Berg