Site icon WP Smith

Using Version Control

Version Control

Recently, I have had multiple discussions with developers who only use FTP for development. One agency told me that they even use FTP for development with multiple developers. This completely shocked me!

I use version control on every site, theme, or plugin I develop. You may believe it is overkill but I cannot express how many times this has saved me and even my clients. 

So why do I use version control? There are six basic reasons why I use version control.

  1. Mistakes. I make mistakes. Everyone makes mistakes. It is human nature. Not planning for those mistakes is planning for failure or lost information, lost time and lost money. 
  2. Offsite Backup. With each site, theme, or plugin I develop, I push my versions offsite to either Github, Bitbucket, TFS, VisualStudio Online, a private Git server, etc. This alone has proven invaluable numerous times whether it was my machine that stopped working from dying of old age or hit by a car or drop kicked or some other catastrophic event, or Act of God. All I have to do is clone or checkout the code and keep on going. 
  3. Multiple Development & Collaboration. Using version control is the only way to do collaborative and team development. I have no idea how this used to be done and how many people have suffered the fate of their work being completely over-written with no recourse. Version control allows for multiple people to work on the same file and not cause each other's code to be completely erased. It does not guarantee that the code won't be in conflict and cause some merging work, but I definitely prefer that over completely re-doing everything because Bob over-wrote my file. 
  4. File Maintenance. Remember the days where the files were named functions1.php, functions2.php, functions-old.php, or functions-bob.php as a way of version control. This is not what I mean at all. Instead true version control allows for me to always have functions.php with a variety of comments and messages about each version. 
  5. Client-Focused. Using version control considers the clients needs before your own. It helps the client be able to switch developers easily. While this may cause you some irritation, the simple thought and even courage to use version control lets your client know that you value them. Also recently, one of my very first clients lost everything because they forgot to renew their domain and host. Since I was able to retrieve the site from my version control and quickly spin up an older version, I locked a client for life and made some extra free monies. 
  6. Future-Oriented. Ever wrote a file, plugin or theme thinking that you will remember what you did and then a month later come back asking yourself, "Who wrote this!? This is aweful." Hopefully the code has comments to help you navigate what is happening without thinking. But if there isn't and if the code is under version control, you could optionally read the commit/change log and get an idea of what is happening. 

If you are not convinced and want to tell me not to use Git, maybe Matthew McCullough would agree?

And for those who believe using version control is akin to reading the matrix, here is a quick video about version control for designers: