How to use SVN to Publish Content to Your Website
Say you’ve started using svn to manage your website content. Now when you commit you want to push changes to your your website.
sshinto your account- back up your web directory:
mv www www.old - make a new web directory:
mkdir www cd www- check out your repository to your web directory. similar to
wget, you need to be specify the correct syntax so that yoursvnfiles checkout nicely so that your web directory shows your index page. For instance check out the correct path from yoursvnrepository to the current directory (the period):svn co http://svn.url.com/trunk/www/ . - to prevent visitors from browsing into your
.svndirectories add the following to your.htaccessfile:
RedirectMatch 403 /\.svn.*$ - then each time you commit changes you update your local repository in your web directory. there are a couple ways to do this, one is to use one of the
svn pre-commit hookto do this automatically, another is to write a script to log into your account and update it, e.g.ssh host 'cd www; svn update; exit;'. at this point it’s quite handy to have passwordless authentication set up with the relevant account.
* * *