russian_spy
russian_spy

Reputation: 6655

svn / subversion: Get ALL files on new check out, but then exclude certain files from update/check in

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.

Upvotes: 2

Views: 1234

Answers (3)

rmeador
rmeador

Reputation: 25696

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.

Upvotes: 1

jeroenh
jeroenh

Reputation: 26772

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.

Upvotes: 1

jason
jason

Reputation: 8918

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.

Upvotes: 5

Related Questions