[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Using SVN to version configuration files.

From: Ryan Schmidt <subversion-2006d_at_ryandesign.com>
Date: 2006-11-08 08:35:40 CET

On Nov 8, 2006, at 00:05, Matthew Joyce wrote:

> I'm not sure I fully understand how SVN works in practice, this is
> what
> I have done :
> Made a repository folder
> /usr/local/svn/nagios
> Create a SVN repository
> svnadmin create /usr/local/svn/nagios/
> Imported my live Nagios config
> svn import /usr/local/nagios/etc file:///usr/local/svn/nagios
> What would be intuitive for me, would be to carry on and edit my
> config
> files, test them, be happy with them.
> Then, commit the changes I've made to SVN as a new version of the
> files.

If that's what you wanted, then an "in-place import" would have
suited you well:


If you haven't already made lots of changes to what's in the
repository, then you could just blow it away ("rm -rf /usr/local/svn/
nagios") and recreate it and do an in-place import.

> What I'm not clear on is, the files in /usr/local/nagios, are they my
> nagios config files, or are they SVNs version of the most recent
> files ?

Subversion does not change any files that you import using "svn
import". What's in /usr/local/nagios now is exactly what was there
before you thought about Subversion.

> Rather, is it ok to edit these files, or should I 'checkout' a copy of
> these files to work on and then commit them, back to the live system ?

You can edit the files, but you won't be getting the changes back to
Subversion from there. For that, you need to make the changes in a
working copy. You can either "svn checkout" a new working copy
somewhere else, or move the current /usr/local/nagios out of the way
("mv /usr/local/nagios /usr/local/nagios-old") and check out the
working copy there. Or, to avoid that, use the in-place import in the
first place.

> If I need to check them out, then it's going to be difficult to test
> them, as they won't be in the right place (for nagios).
> Or do I move all the config files to start with, import them, and then
> use checkout to put them in their natural operating location.
> I have two Nagios machines, would I then checkout the committed config
> to the alternate device ?

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Nov 8 08:37:24 2006

This is an archived mail posted to the Subversion Users mailing list.