Magento & Version Control

Please note: This is a working blog post which means I will be continuing to be editing the blog post as I have the time to include more information.

In 2016, we have self driving cars, Chipotle delivers (via postmates), and 1 gigabit internet speeds. If you are not using version control at this point, I am assuming you are a time traveler from the 1990s.

In a nutshell, version control allows you to see code history, easily allows you to bring code from your local machines, to a staging environment, to production. It also allows you to see if anyone has been editing your code on your servers (like a hacker was able to access your server) and so on.

Personally I use git for version control. There are two main companies that developers use. GitHub and BitBucket.

If you are brand new to version control (I am assuming this since you are reading this article), then you will start out simple. You probably will only have 1 or 2 branches (master & develop). You’ll work on the develop branch in your local and staging environments, and when you are happy with all your changes your merge develop into master.

Later on, you’ll create feature branches, hotfixes, etc. I will not go into detail on this, however I urge you to read this article:¬†

I suggest getting started with this tutorial.

Why does Magento have 3 code pools?

app/code/core – Holds modules that are distributed with the base Magento and make up the core functionality.

app/code/community – Holds modules that are developed by third-parties

app/code/local – Holds custom modules you developed, including Mage code overrides.

Why does Magento use multiple code pools for our customization?

It will load local first, community second, and core third. It uses three for organization purposes and to help solve issues when two+ 3rd party extensions are trying to rewrite the same thing. In a example were you have two extensions in app/code/community trying to rewrite the same model, you can simply make a extension in app/code/local and merge the two extensions logic together.

Why doesn’t Magento use single code pool for customization?

It was done this was to try to have some code organization. Also, when you have 3rd party conflicts, the local is great to help solve those issues. The local is also great to have extensions that only that site will ever have.