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.

How to create custom log files for Magento 1

The standard way for logging is to use

Mage::log(“This will show up in var/log/system.log”);

However, you may want to split these up so specific information goes to the same place. To do this, you simply need to do:

Mage::log(“This will show up in var/log/custom.log”, null, custom.log);

If you need to add a variable you are trying to log, you would use:

Mage::log(“The variable is: ” . $variable, null, custom.log);