tags:

views:

848

answers:

3

I have this setup where in my development copy i can commit changes on a certain file to the repository. Then in my production copy, which does checkouts only, i would normally edit this file because this contains references which are environment independent. Is there any way i can ignore this file on the subsequent checkouts/updates without using svn:ignore? More like a --ignore-files /projectroot/config.php or --ignore-files -F ignoredfiles.txt flag.

+7  A: 

I would suggest renaming the file in the repository from config.php to config.php.sample. This is the file that you would edit to change the default options. For deployment, either to your development environment or to the production server, you would copy config.php.sample to config.php and edit it without worrying about future conflicts.

Greg Hewgill
don't forget to ignore config.php after doing that.
Mauli
thanks for the great tip! I was really thinking of this because this is the only file that change per environment
ken
We have the same problem at work and I still don't get it why a config that is dependent on the environment is actually in a repository.
unexist
the convention is usually to call it config.php.tmpl (for template)
Avi
A: 

Another solution is maintaing all the configuration files for every environment in SVN. Depending on the value of an environment variable, only some files are used.

Advantages:
1. All files in SVN.
2. No copy of files in deploy/checkouts/updates...

Disadvantages:
1. All files in SVN.
2. There is an environment variable.

Banengusk
A: 

An alternative workaround is to use the tsvn:ignore-on-commit property. It will make files always start off unchecked in TortoiseSVN's commit dialog. If you'd want to commit it, you need to manually check it.

http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-commit.html (bottom of the page)

This document talks about a changelist, not a property. Do you have a reference to a property that sets this changelist or something?
Bert Huijben