What is Version Control?
Version control software is used by programmers to keep track of all of the changes made to source code over time. There are many different version control tools available; which one a programming team uses may depend on the type of project, corporate policy, or simply personal preference. Popular version control tools include Git, Mercurial, and Subversion. They all accomplish the same goal, which is to allow programmers to safely develop software without having to worry about losing code.
What are the benefits of Version Control?
For programmers, version control allows them to safely experiment with features and bug fixes without the worry of breaking the existing code or losing any previous code:
- Because version control stores all of the changes made to the code, the programmer can always get back to any version of the code. The programmer can try something out and, if it doesn't work, they can simply revert their changes. This is especially important if they need to make changes to several source files; version control means they don't have to remember exactly what they changed and in which files. More importantly, it makes it difficult to accidentally leave something changed which shouldn't be.
- Because all changes are tracked, it's easy to figure out when and how a bug was introduced into the software. Programmers can just to see what's changed since the last time things worked properly.
- Because all changes are tracked, programmers never have to worry about losing code; if it was ever checked into the system, they can go back and find it. This means they can learn from past code; it also means that they don't need to worry about keeping code around which they might need in the future.
For everyone else, version control also has benefits:
- Because all changes are tracked, it's easy to go back to the previous version of the software. This is invaluable when someone has accidentally introduced a bug into the software; it allows the last known working version of the software to be deployed with relative ease.
- Because the entire history of the code base is available, it's much easier for new programmers to come up to speed on how the code works. This is invaluable for onboarding new programmers or hiring new contractors.
Should my software be under Version Control?
There are no 'buts' on this topic. If you develop software, your software needs to be under version control. If your programming staff does not use version control, they need to start. If the contractors you employ to write your software don't use version control, you need to find new contractors.
Programmers working without version control are like doctors who don't sterilize their equipment, or race car drivers who don't wear helmets. It's needlessly risky to the point of irresponsibility. Version control is as fundamental a software development tool as a compiler or code editor. There is no reason not to be using it. Not even cost - the three tools mentioned above are all free.
But my 'software' is just a website...
Version control also applies to markup files (e.g., HTML documents), stylesheets (CSS files), scripts, any part of your website or application which might change over time. All of these can and should be under version control.