Written by:David Aldridge4/26/2011 4:17 PM
To use SVN to control changes to config directories takes a little bit of work. The following is the simplest way to do it, using my nginx configuration directory as an example:Create Repository:svnadmin create /var/svn/repos/nginxconfigEdit user account:vi /var/svn/repos/nginxconfig/conf/passwd Create user = password line (say admin = myadminpass)Edit authentication:vi /var/svn/repos/nginxconfig/conf/svnserve.conf Uncomment anon-access, auth-access and password-db linesPerform initial commit:svn import /usr/local/nginx/conf svn://localhost/nginxconfig -m "Initial Import" --username adminPerform initial checkout:mkdir ~/tempco svn checkout svn://localhost/nginxconfig --username admin ~/tempcoMove .svn to real directory:mv ~/tempco/.svn /usr/local/nginx/confTo show differences: svn diffTo commit a new revision:svn commit -m "Revision Notes" This allows you to have revision control against your configuration files simply and easily. Using SVN for the /etc directory would allow you to have revision control against most of the config files.
svnadmin create /var/svn/repos/nginxconfig
vi /var/svn/repos/nginxconfig/conf/passwd
vi /var/svn/repos/nginxconfig/conf/svnserve.conf
svn import /usr/local/nginx/conf svn://localhost/nginxconfig -m "Initial Import" --username admin
mkdir ~/tempco svn checkout svn://localhost/nginxconfig --username admin ~/tempco
mv ~/tempco/.svn /usr/local/nginx/conf
svn commit -m "Revision Notes"
1 comment(s) so far...
Re: How to use SVN for revision control on configuration filesIf it is more complex than a single directory then you will need to move the .svn directory for each directory.The following command run from the root of the temporary checkout directory would automate this:find . -iname ".svn" -type d -exec mv {} /where/the/real/dir/is/{} \;
Re: How to use SVN for revision control on configuration files
If it is more complex than a single directory then you will need to move the .svn directory for each directory.The following command run from the root of the temporary checkout directory would automate this:find . -iname ".svn" -type d -exec mv {} /where/the/real/dir/is/{} \;