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?
Version control (svn) for websites
Moderator: General Moderators
Re: Version control (svn) for websites
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.
Re: Version control (svn) for websites
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.
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.
Re: Version control (svn) for websites
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.
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.
Re: Version control (svn) for websites
Tnx, will look into that hook stuff! Heard of that once (quite a while ago), never seen or experimented with it.

CorrectChonk wrote:I'm sure I don't have to mention the importance of testing pre-commit before changes are made to the live site.