views:

653

answers:

3

After a fresh checkout, I want to get ALL files, specifically this file: etc/config.ini

However, once I modify etc/config.ini, I do not want it committed with "svn commit ..." nor should it be reverted on a "svn up".

This would allow you to get default values on an initial checkout (convention over configuration), but then after configuring, you don't want these "local" configuration files committed into svn.

+3  A: 

The best way to do this is not to directly version control the file.

A common way to avoid this issue is to have config.ini.sample (or something along those lines) under version control, and then config.ini ignored in your svn:ignore property.

Then, after checking out, copy config.ini.sample to config.ini and you're good to go. This way you can also version control your template config file.

jason
Yes, but that's a lot of copying. If you're an end-user you want the thing to work right-away on checkout, albeit with default configurations.
russian_spy
@russian_spy: If you are someone smart enough to run a checkout, you can figure out how to copy one file.
jason
A: 

If you use TortoiseSVN and/or VisualSVN (>= 1.5), you can move these files to the changelist 'ignore-on-commit'. This causes the files to show up in a separate section in the commit dialog, and never automatically selected for committing.

Obviously this is a TortoiseSVN-specific solution.

jeroenh
+1  A: 

Jason already hit on the general accepted solution (the one promoted by the SVN folks themselves), but there is another option, if you're using TortoiseSVN as the client. When you're at the commit dialog, right-click the file you don't want to ever commit and choose Add To Changelist->Ignore On Commit. It will still show up in the commit dialog every time you go to commit it, but it defaults to unchecked so it won't actually be committed unless you explicitly check the box. Again, only useful for Tortoise, so if you use the same WC with a non-Tortoise client, you'll accidentally commit it.

rmeador
That's a good option, with caveats. I'd never have thought of that, as I only use the command line client.
jason