• Parth

What is a Version Control System? | All about version control | Git | GitHub | GitLab | CodePlanet

What is a Version Control System?


Version Control System is a system which is capable of recording changes made to a file or a set of files over a time period in such a way that it allows us to get back in time from the future to recall or revisit a specific version of that file.


To explain in simpler words, a version control system is a software package that when initiated will monitor your files and directories for changes and allows you to tag those changes at different levels so that you can revisit that specific tagged states for the files, whenever needed.


When installed and initiated, the version control system creates a local directory at the same place where your files reside, which it uses to manage the entire history of changes you made to your file system.




Why do you need a version control system?


Taking the current scenario in the industry where companies are working on very big projects, each contributing employee to that project works on the same code base, and from time to time they release their product versions with some upgraded features. So whenever the company is done adding and testing a particular upgrade feature they update their major running code base with the made changes. But sometimes there can be a scenario where even after the testing when the product got rolled out for general use, newly added features might be incompatible for some users. So if there's any major bug, the company might need to roll back to the old version of the product, in such case the version control system can be of great use.


Some other use cases for the version control system are :

  1. You maintain multiple versions of the same file under the same name, thus avoiding cluttering of files with small differences in their names mentioning their versions.

  2. It makes collaboration smoother when working in teams.

  3. From time to time, you can study the growth of projects you’re working on.




Types of Version Control System


There are three types of version control systems available. These are classified based on their mode of operation :

  1. Local Version Control System

  2. Centralized Version Control System

  3. Distributed Version Control System

Local Version Control System

If working locally the major choice of many people to keep different versions of the same files is by making copies of the file and storing them in different directories or saving them by renaming files with some minor changes. For the sake of simplicity, this might be a handy thing to do, but this might get a little cluttered in the case if the count of files we’re dealing with gets higher.


To deal with this issue Local VCSs can be used that have a simple database that keeps all the changes to files under revision control.



As shown in image above we can checkout to the specific version in the database and we will restore the state of the file in that particular version.

Local VCSs have a tool called Revision Control System or RCS. RCS works by keeping patch sets (that is, the differences between files) in a special format on disk, by using those patches it can recreate the file as per the needs.




Centralized Version Control Systems

One of the greatest issues with the developers working on the same project is collaboration. Centralized Version Control Systems came out as a good solution for this problem.

In such systems, there is a single central server which contains all the versioned files for the project. With this now the developers can check out the files from the server onto their systems.



This type of system offers many advantages. For example, the server admin can keep track of the contributing people and the extent up to which they’ve contributed. Also, the changes at the server cannot be made without the Admin’s permissions.

As compared to any other centralized system, this system also offers similar disadvantages. If the server gets overloaded, the file’s through the server cannot be accessed. If the server gets corrupted then the data will be lost, if proper backups aren’t kept. The local VCCs also offer similar disadvantages, ie, if your local system gets corrupted all your data will be lost.


Distributed Version Control System

Overcoming the disadvantages offered by local and centralized VCSs comes the Distributed VCSs, which involves the concepts of both local and centralized VCSs combined into one.




In Distributed VCSs there is a remote server in which all the files are stored, and the clients can not only read those files along with that they can replicate a mirror of the server system (also known as repository) onto their local systems. So in the case when the server is inaccessible, a developer can continue with its work without any hassles. And Since both of them work synchronously, the changes made onto the local system can be written onto the remote server (also known as push) later on.

This system also makes the collaboration much easier, as everything works synchronously, apart from that different groups of people can work on different features simultaneously, with a properly maintained workflow and changes history.




This was a brief introduction about Version control systems, in the forthcoming blog, we will discover Git, one of the most popular Distributed Version Control Systems. And we’ll also discover how Github Services (the most popular company for hosting remote repositories) can actually be used.