0

I am currently developing a medium sized web application using PHP and need to use some kind of version control. I also need to have the master copy of the code running in the apache document root so I can test the app while it is in development. Does anyone have any sugestions?

Thanks, RayQuang

3 Answers 3

3

You can't go wrong with Git; everything you need to know is here: http://progit.org/book/

1
  • I agree. I've used SVN and Mercurial in the past (even SourceSafe, although I'm still ashamed of that), but I love git the most of all :)
    – Blizz
    Nov 20, 2010 at 9:41
2

Yeah you should definitely use version control (Git or Subversion).

Here a short explanation how I'm using it in my web projects (I am using SVN):

  1. I have a SVN project which I have checkouted on my local machine and on the webserver
  2. Always when you change something you can commit your current running version
  3. Log into the server (Could also be multiple servers) and do a svn update, so the newest code gets automatically deployed on the machine. The only thing you have to do is restart of the webserver

Note:

  • Take care what you commit. You've maybe another database configuration file on your local machine than on your server. You can put this into the svn ignore file list (guess git has something similar)
  • It is also easy possible that multiple persons work on the same project..
  • Don't commit logfiles

Links:
Git: http://git-scm.com/
Subversion: http://subversion.tigris.org/

1

I'd recommend Mercurial for its ease of use and that it keeps the working copy uncluttered, all versioning information is kept in just one .hg folder. I'd do it like this:

  1. Set up a Mercurial repository at the server (hg init)
  2. Do a hg clone of that repository to where you want your working copy
  3. Work away!
  4. When you want to test on the server, do a hg commit and hg push to move the changed files to the server
  5. Run hg update on the server, or add

    [hooks]
    changegroup = hg update >&2

    to the .hg/hgrc file (create it if it doesn't exist) on the server to have it automatically update.

For more info, you can also check out: http://hginit.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.