Version Control, What It Is, Why It Matters

If your dev team are not using any kind of version control, it is one of the single most effective and easiest things you can do right now to make projects more manageable and more profitable.

Aimed at (version control less) developers, project managers and business owners this blog will walk you through what version control is, why it's important and give a brief introduction on how to leverage its power to make for a happier, more profitable dev team.

So what exactly is version control?

At its most simple, version control is the ability to keep a complete history of every version of a document that ever existed.

Example please

Take this blog. It first started out life as a selection of scribbles and bullet points, later it became half-coherent sentences, later still I improved the sentence structure and grammar (hard to believe I know), and then I deleted some text I didn't like, and then my copywriter / girlfriend made some amends...I then undid some of those amends (sorry chlo). What version control would allow me to do is take snapshots at each of these stages and then quickly allow me to browse back through them in the future. Allowing me to quickly see what I wrote, what I changed and when I did so. I am sure you will agree it's a very handy sounding premise and it's particularly useful when you apply the concepts to more complex data types such as code.

Different types of version control

There are a few different types of version control. In my adventures as a web developer and technical director, I have found Git to be the most ubiquitous and simplest method of version control, especially in the creative industries where I have focused my career. As such this blog centers around version control with Git. However the principles discussed are relevant to other version control systems too.

It's all In the repo

So where are all these versions of your code kept?; In the repository, or 'repo'. Think of the repo as offsite cloud storage, which developers can quickly reference. Allowing them to check they have the latest version of the code and catch up on what's changed since they last looked at it.

Popular Git repository hosts include

Terminology

There are three bits of terminology you need to understand before proceeding with this blog, Thankfully they are easy concepts to grasp.

Git commit
The act of taking a snapshot of your code; saving a version.

Git Push
The act of pushing your snapshots to the repository.

Git Pull
The act of pulling the commits of others down from the repo.

Git has many more commands than this. The commands i have listed also have further function. However, for the purpose of understanding this article these are the three that will allow you to understand the core concepts I am outlining here.

So why is this useful to me?

Now we understand a little bit about what Git is, the next question to answer is why is it helpful to you?

Ability to roll back

Your code was working a couple of hours ago; now it's mysteriously stopped working!? Using version control you can rollback through your commits and find the last commit where the code in question is working. You can then compare code from the working commit to your broken code. In effect massively narrowing down the amount of code you have to search through to make a fix; if you're looking for the needle, it makes the haystack substantially smaller.

Absent Developers

Because using version control makes your code accessible to everybody on your team, you no longer become reliant on one dev. If a developer gets ill, is out visiting a client (some devs like to be sociable) or mysteriously disappears, any other developer will be able to pick up where he / she left off, just as long as the absent Dev pushed to the repo before disappearing.

Client flip flopping

You should be locking your customers down at the start of a project with functional and technical specifications. However, anyone who has ever worked in an agency knows; there is always scope for the client to change their mind. Client flip-flopping can be made slightly less painful with version control. Need to restore that functionality the client made you remove last month? With version control, this is a straightforward task.

Accountability

Using Git, you can see who coded what and when. Even the none developers can do so. As such it makes developers accountable for their choices. This is particularly useful when working with contractors and freelancers. If they come in and smash something, you can take action with indisputable evidence at hand.

Collaboration

Version control makes collaboration with third parties much simpler. Say your team have coded up some templates and that code needs to be passed on directly to the client. Rather than packing up the code and sending it on, you can just provide them with a link to the Git repo where they can download the latest version of your code.

Remote working

Got a Dev working offsite today? No problem, with version control they can easily access and update the codebase from anywhere with an Internet connection.

Other Code Management

Training a new developer up? Or maybe you need to keep an eye on what your new contractors doing? Version control makes it very easy to keep track of what they are doing. Making coaching and management of developers an easier task.

Taking version control to the next level

What I have discussed so far are some very basic applications of just how much version control can do for you - it can, however, do even more things like;

  • Git based deployments; scripts that take the code from the repo and move it to the production server for you (no more FTP)
  • Commits can be tied into your bug tracking system, allowing you to see what code was written to fix particular bugs.
  • Commits can be linked to your time tracking software, see exactly how long certain tasks take
  • Commits can be linked into your agile process
  • Multple "branches" or versions
  • Much more advanced version control then the basic concepts discussed in this blog

Commandline Vs. Git Clients / Apps

There are two primary ways in which you work with Git. The command line or a Git client / application. So what's the difference? Think of the command line as you giving direct instructions to a computer; matrix style! Whereas Git clients give the commands to the computer for you.

A wise developer once tweeted...

Essentially; Git clients are a bit rubbish. They discourage developers from learning how to use Git properly, and prevent them from learning what is 'under the hood'. Generally speaking your devs should be using the command line to work with GIT, even juniors can be taught the absolute basics in a matter of hours.

Resources to get you started

Liking the sound of version control? There are many free resources to help you get started.

In conclusion

Every now and again you come across something in business which you adopt and in a minuscule space of time wonder how you ever managed without. Adopt version control now and in two months time, looking back at life pre version control will feel like the dark ages. It will make your developers and all those who have to work with them happier for the headaches it saves and will ultimately increase the profitability of your team.

Edd Smith

Read more posts by this author.

Subscribe to Edd Smith | Technical Direction & Web Development

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!