Alex Rivera | Logout

What's the best way to use SVN to version control a PHP site?

Asked 2008-09-22T20:05:55.507
11

I've always just FTPed files down from sites, edited them and put them back up when creating sites, but feel it's worth learning to do things properly.

I've just commited everything to a SVN repo, and have tried sshing into the server and checking out a tagged build, as well as updating that build using switch.

All good, but it's a lot lot slower than my current process.

What's the best way to set something like this up? Most of my time is just bug fixes or small changes rather than large rewrites, so I'm frequently updating things.

Edit
Report

1 Answer

1

For my projects, I usually have a repo. On my laptop is a working copy, and the live website is a working copy. I make my changes on the local copy, using my local webserver. When everything is tested and ready to go, I commit the changes, then I ssh into the remote server and svn update.

I also keep a folder in this repository which contains sql files of any changes I've made to the database structure, labelled according to their revision number. For instance, when I commit Revision 74 and it has a couple extra columns in one of the tables, included in the commit will be dbupdates/rev74.sql. That way, after I do my svn update, all I just have to run my sql file (mysql db_name -p -u username < dbupdates/rev74.sql) and I'm good to go.

answered 2008-09-22T20:19:54.913

Your Answer