Need some advice on project management with Magento.

I have been putting my whole project under source control but its becoming a nightmare to manage. I am now thinking of installing a base magento on local dev and live and then just putting my local code directory, design and theme directory under source control (svn in my case).

Obviously this has drawbacks also.

Can some more experienced developers offer some advice on how they manage their code on magento projects between local, dev and live sites.

1 Answer 1


you didn't specified what version control you are using. Easiest way to do cowboy development is to use git for version control and here's how to:

  1. make a git repo master branch that has all magento versions in it although not necessary (http://blog.speedupmate.com/post/4063307705/magento-git-mirror)
  2. checkout your dev branch with the version you like to use (git checkout -b dev_branch)
  3. checkout your stage branch from dev branch (git checkout -b stage_branch dev_branch)
  4. checkout your live branch from dev branch (git checkout -b live_branch dev_branch)
  5. on your localhost checkout the dev branch and develop there and if some feature is ready for committing you can commit it and push the changes to your remote repo. If your remote repo is on the same server where your live site then it is all you have to do to get your changes to the server
  6. next step is to move changes to staging and that is just merging stage and dev branch. Stage is the place where you have a replica of live database and client or you can test the development in live like conditions
  7. if your tests are good and changes are approved you can merge your changes from dev to live

On your live server you have staging and live environments checked out from your git repo to the public folders where domains are mapped so those site installations are actually checkouts from your git repo

On your localhost you have a site that is checked out from dev branch and you never checkout live or staging branch there and you don't commit to those branches only to dev branch and not to master, stage or live that way you can push your changes to remote without conflicts

Also a good thing to have a .gitignore file in place that will ignore any files under var, media or pear cache folders so you don't version unnecessary stuff that is unique for each environment. Also its good to ignore any local setup files like local.xml

You can also automate this with fabric , capistrano or git hooks and similar tools

Your Answer

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