Version control (svn) for websites

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Version control (svn) for websites

Post by Apollo »

I do a lot of offline (stand-alone apps) as well as online development. For offline development, I always use Subversion (SVN) for version control. Works perfectly.

Now, I'm looking for something similar for online / website development. Until now, I always had a local copy of all my files, everything in an svn repository, and I uploaded the files (excluding the .svn dirs) to the online server. This is a somewhat tedious procedure, and doesn't really seem to fit with an optimal workflow.

Perhaps it'd work better if I had SVN running on the server. However, this makes the server software dependent (it should have SVN) which makes moving to a different server one stepp less easy, and I don't want the version control metafiles (the .svn dirs) in the live environment.

How do you guys 'n gals deal with this?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Version control (svn) for websites

Post by Benjamin »

Are you doing an export before you upload the files or are you uploading the files manually, skipping the .svn folders? I have my FTP client configured to ignore .svn folders, so I can do it either way.
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Version control (svn) for websites

Post by Apollo »

Upload manually. But now you mention it, doing an export on the server might make things easier. Perhaps with some script that exports to a temp folder, and if successful, then swaps the website's "live" folder with the temp one.

This also prevents the tendency of editting stuff online (getting out of sync / not in svn) by anyone involved, as that will be lost with every next export/update.
Chonk
Forum Newbie
Posts: 24
Joined: Fri May 28, 2004 3:58 am

Re: Version control (svn) for websites

Post by Chonk »

You need to utilise svn-hooks, specifically the post-commit hook. This will run AFTER anything has been committed , usually an email script to inform people of an update etc.

I've used it before with great success , here is a link ( http://www.tylermcmanus.com/category/svn/ ) that should get you on your way. It details the svn update method and removing access to .svn folders via apache configs too.

I'm sure I don't have to mention the importance of testing pre-commit before changes are made to the live site.
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Version control (svn) for websites

Post by Apollo »

Tnx, will look into that hook stuff! Heard of that once (quite a while ago), never seen or experimented with it.
Chonk wrote:I'm sure I don't have to mention the importance of testing pre-commit before changes are made to the live site.
Correct :)
Post Reply