How can I manage this CodeIgniter/PHP + Subversion workflow?
I've set up Subversion using Beanstalk + Coda for my web app, which up until now I've just been managing locally and manually. So I've got it set up successfully and in my local folder, alongside my CodeIgniter installation, I can see the branch/trunk/commit folders.
Now I've been told that you should save all your working files in the trunk folder. However, I still want to test the site locally with my MAMP installation. Does that mean I need to copy my entire site into the trunk folder, change MAMP's root URL to mysitefolder/trunk
and run it from there - thus saving any changes automatically to trunk?
Because that way, when I need to push changes to the FTP server - live changes for the actual web app the users will use - I'll need to manually move/copy the files 开发者_StackOverflowout of trunk and into the root, then FTP them up.
That strikes me as a bit of an illogical workflow. Am I going about this incorrectly, or is that really what you'd have to practically do?
Generally speaking the svn server would be set-up on your remote server and you wouldn't need to use FTP at all. You would create the repository on the server, do a local checkout of the files to your local root directory. Once they are there you can work on them locally until you are happy with them, at which point you would commit them to the remote server. Then on your server you would probably have a cron job or other service that will copy the files from your branch directory of your repository, to the actual document root folder of your site, this would run at say midnight every day, to ensure the site gets updated daily.
If you didn't want to go this whole hog, or don't have the ability to install an SVN server on your remote server then the local alternative would be to use the same process with regards to checkout and commit, but then using SVN export to get a copy of the files (sans the .svn folders) to upload via FTP when you are ready to push the changes live.
At least that's my understanding of the work flow. Hope it helps.
精彩评论