I’ve always developed by working on a live server modifying the files direclty off the server. I am really wanting to break the horrible habit and start using version control and applying patches when fully tested.
I should also explain how i work. I always wite code bit by bit, testing how each part works. I’ll throw up a quick visual prototype, and then start “filling in” the missing pieces, saving and testing all along the way.
My question though is how can i test the code and how do I release it. Should i have a live server that duals as a repository so that whenever i save the file it commits to the repository and is ready for me to test? Then when its all done and tested copy the repository and upload it to the live server? I’m not really sure how to start.
You’ll want a source code repository/server.
We use Git, though we’ve also used Subversion in the past, in a similar fashion.
You will have at least two web servers:
On the development server, you will make your changes. Test on development also. When you are ready to go live, you will commit the changes from the development server to the repository. You will then pull the changes from the repository to the production server.
Alternatively, you might have three web servers:
Here, instead of testing on development, you will test on Test. This will allow you to keep developing while you’re testing a particular branch.