Skip to main content

An Introduction to Version Control Systems (VCS)

An Introduction to Version Control Systems(VCS)

Introduction

Version control systems are a category of software tools that help a software team manage changes to source code over time. Version control software keeps track of every modification to the code in a special kind of database. If a mistake is made, developers can turn back the clock and compare earlier versions of the code to help fix the mistake while minimizing disruption to all team members.Changes are usually identified by a number or letter code, termed the "revision number", "revision level", or simply "revision". For example, an initial set of files is "revision 1". When the first change is made, the resulting set is "revision 2", and so on. Each revision is associated with a timestamp and the person making the change. Revisions can be compared, restored, and with some types of files, merged.

[*]Source Code is a repository of the invaluable knowledge and understanding about the problem domain that the developers have collected and refined through careful effort.

Why use Version Control Systems(VCS)?

Developing software without using version control is risky, like not having backups. Version control can also enable developers to move faster and it allows software teams to preserve efficiency and agility as the team scales to include more developers.

  1. A complete long-term change history of every file. This means every change made by many individuals over the years. Changes include the creation and deletion of files as well as edits to their contents.
  2. Branching and merging. Having team members work concurrently is a no-brainer, but even individuals working on their own can benefit from the ability to work on independent streams of changes. 
  3. Trace-ability. Being able to trace each change made to the software and connect it to project management and bug tracking, and being able to annotate each change with a message -describing the purpose and intent of the change can help the root cause analysis.

Why you should learn Version Control ?

When you are in development environment you are not going to do any task individually, you will be part of a team and some task will be assigned to you. Now you must have to work on Version Control Systems , because every big corporate industry who deal with software , have a Version Control System of their own. The name might change but the concepts and working procedures non the less are same. So If you are going to be a part of such organization you must have a prior idea about this systems which might give a push to your journey. So go through this article very thoroughly and understand the essence and usage of VCS.

Important terminologies


Repository: A shared database with the complete revision history of all files under version control. It’s a master storage to store multiple revisions of all the files.


Workspace : Also known as working copy. It’s a set of files on your local machine that you have retrieved from the Version Control Repository at a specific time or revision.  You need to checkout-out data from central repository to your local workspace and then all the work needs to be done on a working copy and then publish it to central repository so that everyone else can see them.



Trunk : The unique line of development that is not a branch (sometimes also called Baseline, Mainline or Master). It’s a main body of development, originating from the start of the project until the project completes.



Branches : It’s a set of files which needs to be created at one particular time so that, from that time forward, two copies of those files may develop at different speeds or in different ways independently of each other. Branches are also known as “lines of development”. Even when a project has no explicit branches, development is still considered to be happening on the “main branch”, also known as the “main line” or “trunk” or “master“.

Tag : A tag or label snapshot in time, consistent across many files  for a particular state of the project at a point in time. Tags are generally used to mark interesting snapshots of the project. A tag is usually made for each release, so that we can obtain, directly from the version control system, the exact set of files/revisions comprising that release.

Check-out : This action creates a copy of the particular revision of a file [often latest] from the repository to your workspace. When you check out a directory, you check out all files and subdirectories under it. You can also has the ability to just checkout single directory if you wish so.

Update/ Pull  : Update your working copy with the latest either through central repository or through the other team member’s local workspace in case of DVCS.

Commit/ Check-In :  To make a change to the project; or  to store a change in the version control database in such a way that it can be incorporated into future releases of the project. This copies your working directory back into the repository as a new version.

Push : In CVCS, commits are automatically and unavoidably pushed up to a predetermined central repository, while in DVCS the developer chooses when and where to push commits. Often it is the project’s master repository, the one from which public releases are made, but not always.

Log Message: A brief message about changes made to a revision when you check it in. The log messages can be used as a summary of the progress of changes in a file.

Revision/Version : A committed change in the history of a file or set of files. This is the numerical reference supplied by the VCS to track the different editions it is holding of the file.

Conflict : The situation when two members are trying to commit changes that affect the same region of the same file. These must be resolved either manually or by using a Merge tool.

Merge : Combining multiple changes made to different working copies of the same files in the source repository. Merging is a strategy for managing conflicts by letting multiple developers work at the same time (with no locks on files), and then incorporating their work into one combined version.

Types of Version Control Systems

Local Version Control

Local Version Control Systems  


Many people’s version-control method of choice is to copy files into another directory (perhaps a time-stamped directory, if they’re clever). This approach is very common because it is so simple, but it is also incredibly error prone. It is easy to forget which directory you’re in and accidentally write to the wrong file or copy over files you don’t mean to.



To deal with this issue, programmers long ago developed local VCSs that had a simple database that kept all the changes to files under revision control.



Centralized Version Control

Centralized Version Control Systems

The next major issue that people encounter is that they need to collaborate with developers on other systems. To deal with this problem, Centralized Version Control Systems (CVCSs) were developed. These systems (such as CVS, Subversion, and Perforce) have a single server that contains all the versioned files, and a number of clients that check out files from that central place. For many years, this has been the standard for version control.This setup offers many advantages, especially over local VCSs. For example, everyone knows to a certain degree what everyone else on the project is doing. Administrators have fine-grained control over who can do what, and it’s far easier to administer a CVCS than it is to deal with local databases on every client.


Distributed Version Control

Distributed Version Control Systems

This is where Distributed Version Control Systems (DVCSs) step in. In a DVCS (such as Git, Mercurial, Bazaar or Darcs), clients don’t just check out the latest snapshot of the files; rather, they fully mirror the repository, including its full history. Thus, if any server dies, and these systems were collaborating via that server, any of the client repositories can be copied back up to the server to restore it. Every clone is really a full backup of all the data.

Some Famous VCS 

1. GitHub

GitHub helps software teams to collaborate and maintain the entire history of code changes. You can track changes in code, turn back the clock to undo errors and share your efforts with other team members.

It is a repository to host Git projects. For those wondering what is Git? It is an open source version control system that features local branching, multiple workflows, and convenient staging areas. Git version control is an easy to learn option and offers faster operation speed.

2. GitLab

GitLab comes with a lot of handy features like an integrated project, a project website, etc. Using the continuous integration (CI) capabilities of GitLab, you can automatically test and deliver the code.

You can access all the aspects of a project, view code, pull requests, and combine the conflict resolution.

3. Bitbucket

Bitbucket is a part of the Atlassian software suite, so it can be integrated with other Atlassian services including HipChat, Jira, and Bamboo. The main features of Bitbucket are code branches, in-line commenting and discussions, and pull requests.

It can be deployed on a local server, data center of the company, as well as on the cloud. Bitbucket allows you to connect with up to five users for free. This is good because you can try the platform for free before deciding to purchase.

4. AWS CodeCommit

AWS CodeCommit is a managed version control system that hosts secure and scalable private Git repositories. It seamlessly connects with other products from Amazon Web Services (AWS) and hosts the code in secured AWS environments. Hence, it is a good fit for the existing users of AWS.

AWS integration also provides access to several useful plugins from AWS partners, which helps in software development.

5. Microsoft Team Foundation Server

Developed by Microsoft, the Team Foundation Server is an enterprise-grade tool to manage source code and other services that need versioning. It can keep track of work items to find defects, requirements, and scenarios in a project.

It comes with several unique features like Team Build, data collection and reporting, Team Project Portal, Team Foundation Shared Services, etc.

6. CVS Version Control (Concurrent Versions System)

CVS is one of the oldest version control system and is a well-known tool among both commercial and open source developers. It allows you to check out the code you are planning to work on, and check-in the changes.

It has the capability to handle projects with multiple branches so that teams can merge their code changes and contribute unique features to the project.

Since CVS is here for a long time now, it is the most mature version control software.

Conclusion

Version control systems are essential part of the professional journey as well as for a aspiring student who wants to start a carrier in software industry . So I hope this article helped you to understand the topics. In the next article of this series I will discuss Git. Share if you liked it.

References





Comments

Popular posts from this blog

Problem Solving and Algorithms

Problem Solving and Algorithms Introduction A problem space is all of the various components that go into creating a resolution for a problem. Think of it like a frame, which acts as something of a border to help define an area. A problem space helps you or, on a larger scale, a business, figure out what the problem is, work through ways to correct them and then drives implementation of the appropriate solution. The ultimate purpose is to take corrective action for some identified problem. Problem solving refers to cognitive processing directed at achieving a goal when the problem solver does not initially know a solution method. In computer science there are two different types of problems, ill-defined and well-defined : different approaches are used for each. Well-defined problems have specific end goals and clear expected solutions, while ill-defined problems do not. In computer science, an algorithm is a finite sequence of well-defined , computer-implementable inst...

A Beginner's Guide to System Design

A Beginner's Guide to System Design Introduction Systems design is the process of defining the architecture, modules, interfaces, and data for a system to satisfy specified requirements. Systems design could be seen as the application of systems theory to product development. There is some overlap with the disciplines of systems analysis, systems architecture and systems engineering. Whether you are a backend developer, product manager or technical manager, everyone needs to know the basics of System Design. So this article is the only destination that can solve all queries you have about System Design. Aspects of System Design High Level System Design High-level design ( HLD ) explains the architecture that would be used for developing a software product. The architecture diagram provides an overview of an entire system, identifying the main components that would be developed for the product and their interfaces. The HLD uses possibly nontechnical to mildly te...

A Basic Overview of LINUX

A Basic Overview of LINUX Introduction Linux is a family of open source Unix-like operating systems based on the Linux kernel,an operating system kernel first released on September 17, 1991, by Linus Torvalds . Linux is typically packaged in a Linux distribution.Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project.Popular Linux distributions include Debian , Fedora , and Ubuntu . Commercial distributions include Red Hat Enterprise Linux and SUSE Linux Enterprise Server . Desktop Linux distributions include a windowing system such as X11 or Wayland , and a desktop environment such as GNOME or KDE Plasma . Distributions intended for servers may omit graphics altogether, or include a solution stack such as LAMP . Because Linux is freely redistributed, anyone may create a distribution for any purpose.Linux was originally developed for personal computers based on the Intel x86 architecture, but has ...