On the SVN server, there is a file called config.conf
. I have a local version called the same thing (in the same place). How can I make sure that my loc
Ignoring the file should help you:
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-ignore.html
TortoiseSVN has a nice answer for half of this problem: ignore-on-commit
This prevents you from accidentally committing "local only" changes, but it doesn't solve the problem on accidentally updating a locally changed file.
Check out this blog post for the detailed how to:
http://blog.baljeetsingh.net/2009/02/tips-tricks-svn-ignore-on-commit.html
I don't know what sort of setup you have, or if this is applicable to whatever language you happen to be using, but this is the way I do it with websites and PHP.
First, you create default configuration, which probably has naive values that won't work for 90% of setups, but gives you a reference for what values there are, and what can actually be configured. This script is usually called 'config.default.php
' or something in a similar vein. At the bottom of this script is something to the tune of:
if (file_exists("config.php")) require "config.php";
Simple logic. If there's a user override for the config file, then load it in, and let it override whatever it needs to. Then simply keep this user config file ignored via the methods already explained on all the development machines, and any production machines that keep a svn checkout for whatever reason. This is a very flexible setup, and similar procedures could be setup for most languages/environments.
Thanks to everybody. I thought Eoin might be mad, but in fact it's true. You cannot ignore a file that is in version control.
According to the Tortoise docs
Ignoring Versioned Items
Versioned files and folders can never be ignored - that's a feature of Subversion. If you versioned a file by mistake, read the section called “Ignore files which are already versioned” for instructions on how to “unversion” it.
And from the SVN docs
I have a file in my project that every developer must change, but I don't want those local mods to ever be committed. How can I make 'svn commit' ignore the file?
The answer is: don't put that file under version control. Instead, put a template of the file under version control, something like "file.tmpl".
Then, after the initial 'svn checkout', have your users (or your build system) do a normal OS copy of the template to the proper filename, and have users customize the copy. The file is unversioned, so it will never be committed. And if you wish, you can add the file to its parent directory's svn:ignore property, so it doesn't show up as '?' in the 'svn status' command.
This is terribly annoying... I guess I'll just have to be careful with that file and make a backup copy of my own config (which I can ignore).
Thanks to everybody for your answers.
You can add an svn-ignore: attribute to your local folder that excludes config.conf or even *.conf
But I believe, you'd have to completely exclude this file from SVN, i.e. if its already been checked in to the repo, you'll need to delete it rfrom the repository first