<p>We have a PHP project that we would like to version control. Right now there are three of us working on a development version of the project which resides in an external folder to which all of our Eclipse IDEs are linked, and thus no version control.</p>

<p>What is the right way and the best way to version control this?</p>

<p>We have an SVN set up, but we just need to find a good way to check in and out that allows us to test on the development server. Any ideas?</p>

[{'answer_id': 4956, 'author': 'Shawn', 'author_id': 26, 'author_profile': 'https://Stackoverflow.com/users/26', 'pm_score': 0, 'selected': False, 'text': '<p>Each of you could run it locally, or on your own dev server (or even the same one with a different port...).</p>\n'}, {'answer_id': 4965, 'author': 'Marcel Levy', 'author_id': 676, 'author_profile': 'https://Stackoverflow.com/users/676', 'pm_score': 6, 'selected': True, 'text': "<p>We were in a similar situation, and here's what we ended up doing:</p>\n\n<ul>\n<li>Set up two branches -- the release and development branch.</li>\n<li>For the development branch, include a post-commit hook that deploys the repository to the dev server, so you can test.</li>\n<li>Once you're ready, you merge your changes into the release branch. I'd also suggest putting in a post-commit hook for deployment there.</li>\n</ul>\n\n<p>You can also set up individual development servers for each of the team members, on their workstations. I find that it speeds things up a bit, although you do have some more setup time.</p>\n\n<p>We had to use a single development server, because we were using a proprietary CMS and ran into licensing issues. So our post-commit hook was a simple FTP bot.</p>\n"}, {'answer_id': 4968, 'author': 'cmcculloh', 'author_id': 58, 'author_profile': 'https://Stackoverflow.com/users/58', 'pm_score': 0, 'selected': False, 'text': '<p>One possible way (there are probably better ways):</p>\n\n<p>Each of you should have your own checked out version of the project. </p>\n\n<p>Have a local copy of the server on your computer and test it there throughout the day. Then at the end of each day (or whenever), you merge together whatever you are ready to test, and you check it out onto the dev server and test it.</p>\n'}, {'answer_id': 4976, 'author': 'Justin Tanner', 'author_id': 609, 'author_profile': 'https://Stackoverflow.com/users/609', 'pm_score': 2, 'selected': False, 'text': '<p>One way to use subversion for PHP development is too setup a repository for one or all three developers, and use this repository, more as a syncing tool, than true version control.</p>\n\n<p>You could,</p>\n\n<ul>\n<li><p>Make a repo</p></li>\n<li><p>Add your entire PHP document structure of your project</p></li>\n<li><p>Checkout a copy of this repo into the correct spot on your dev server</p></li>\n<li><p>Use an svn hook, that activates on commit</p></li>\n</ul>\n\n<p>This hook, will automatically update the contents of the dev sever, whenever anybody on the team checks in any code.</p>\n\n<p>Hook resides in:</p>\n\n<blockquote>\n  <p>svn_dir/repo_name/hooks/post-commit</p>\n</blockquote>\n\n<p>And could look like:</p>\n\n<blockquote>\n  <p>/usr/bin/svn up /path_to/webroot --username svn_user --password svn_pass</p>\n</blockquote>\n\n<p>That will update your working copy on the dev server to the latest check in.</p>\n'}, {'answer_id': 5325, 'author': 'dragonmantank', 'author_id': 204, 'author_profile': 'https://Stackoverflow.com/users/204', 'pm_score': 3, 'selected': False, 'text': "<p>Here is what we do:</p>\n\n<ul>\n<li>Each dev has a VM that is configured like our integration server</li>\n<li>The integration server has space for Trunk, each user, and a few slots for branches</li>\n<li>The production server</li>\n<li>Hooks are in Subversion to e-mail when commits are made</li>\n</ul>\n\n<p>At the beginning of a project, the user makes a branch and checks it out on their personal VM as well as grabs a clean copy of the database. They do their work, committing as they go.</p>\n\n<p>Once they have finished everything in their own personal space they log into the integration server and check out their branch, run their tests, etc. When all that passes their branch is merged into Trunk.</p>\n\n<p>Trunk is rebuilt, the full suite of tests are run, and if all is good it gets the big ol' stamp of approval, tagged in SVN, and promoted to Production at the end of the night.</p>\n\n<p>If at any point a commit by someone else is made, we get an e-mail and can merge those changes into our individual branches.</p>\n"}, {'answer_id': 6221, 'author': 'Jarin Udom', 'author_id': 574, 'author_profile': 'https://Stackoverflow.com/users/574', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://beanstalkapp.com" rel="nofollow noreferrer">Beanstalk</a> has built-in post-commit hooks for deploying to development, staging, and production servers.</p>\n'}, {'answer_id': 100683, 'author': 'Mladen Mihajlovic', 'author_id': 11421, 'author_profile': 'https://Stackoverflow.com/users/11421', 'pm_score': 0, 'selected': False, 'text': '<p>Another tool you can use for the builds is <a href="http://www.jetbrains.com/teamcity/" rel="nofollow noreferrer">TeamCity</a> which is free for 20 build configurations (enough for most small companies/projects.) This way you can run your tests as well as schedule builds.</p>\n'}, {'answer_id': 2465935, 'author': 'mercu43', 'author_id': 296044, 'author_profile': 'https://Stackoverflow.com/users/296044', 'pm_score': 2, 'selected': False, 'text': '<p>What about something distributed? You can start for example with Mercurial, try different workflows, and see which one fits you the best. </p>\n'}]
['https://Stackoverflow.com/questions/4949', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/673/']