Home FAQ Introduction To Version Control System
Introduction To Version Control System

Introduction To Version Control System

By editor
81 Views

If you are a programmer or developer and working on software applications or any website, you will definitely require some versioning system to track the changes. Version Control System is also referred as SCM (Source Code Management) tools or RCS (Revision Control System).

Version control is a method or a category of software tools that helps to keep a track of changes in the code so that if something goes wrong, we can make comparisons in different code versions and can easily revert to previous versions. It is very helpful when multiple developers are continuously working or changing the source code.

Advantages of Version Control System

Using VCS, the programmers can review the project history to find out the following details:

  • Which changes were made in the code?
  • Who made the changes in the code?
  • When were the changes made in the code?
  • Why were changes needed?

Here is a simple graphical illustration that gives you an idea about how VCS actually works.

how vcs works

Picture Source: https://learn.ni.com/

In the above figure, first line with the light blue balls are the master branch which is the main branch of the source code. So v0.1 and v0.2 are the multiple versions created to take the kind of snapshot of the whole source code. We have created multiple branches from the master branch like release, develop and hotfix branch according to the requirement. Multiple developers can work on the same project by creating different branches and at the end merge it to the master branch.

Types of VCS

There are two types of VCS, namely:

  1. Centralized version control system (CVCS),
  2. Distributed version control system (DVCS).

First, let us see a quick glance about Centralized version control system.

Centralized version control system

Centralized version control system

Centralized version control system works on a Client-Server relationship. Server will have all the information which is
transferred to the client. You can say that it is a kind of shared repository which provides latest code to the developers. So developers will be working on master copy every time. It is as simple as you have to pull the latest copy of code, work on it (commit changes) and then push the code back to repository.

The main disadvantage of the Centralized VCS is that it is a single point of failure. If central server went down then you cannot used it. If you are doing remote commit then it will take time as well. You will need internet connectivity to commit any changes.

Examples:

  • Open source -> Concurrent Versions System (CVS), Subversion (SVN).
  • Proprietary -> TeamCity, Vault, IBM Configuration Management Version Control (CMVC).

Distributed version control system

Distributed version control system

Distributed version control system has a centralized repository as well as all developers have local copy of repository.
Developers can work on their local copy simultaneously. They do not required internet connectivity to work on the code. They can do everything in the code except push and pull. If the central server went down then also there will be no impact because of the local repository.

Examples:

  • Open source - Git, Mercurial, Bazaar.
  • Proprietary - Visual Studio Team Services, Plastic SCM.

Difference between SVN (Centralized VCS) and GIT (Distributed VCS) architecture

The following graphic explains the difference between CVCS and DVCS.

Difference between SVN and GIT

From the above figure we can easily recognized that in SVN (Centralized VCS) we have only central repository but in GIT (Distributed VCS) we have central repository as well as local repository.

Hope you got the basic idea about VCS and its types. We will publish more guides related to VCS in the days to come. Stay tuned!


About the Author:

Dhruv Tiwari is a DevOps Engineer who loves automating things, working with Linux at scale and dream of the day when systems are smart enough to never need to login to a Linux box. Journey Of CI/CD from source code to code deployment to production.


Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More