Git Tutorial 1 – What is Version Control System?

Introduction

As a part of GIT Tutorials End To End, we will learn about Version Control System i.e. VCS or Source Control System in this post.

Did you know that I have started a YouTube channel as well and I need your support to make it successful. Please do watch content then comment, like, share, and obviously subscribe.

YouTube Video Link

You can watch my YouTube video tutorial on this topic here –

Real-time Scenarios

  1. Your manager at work asks you to work on a critical research task. You work hard on that and submit the first version of the document for review. There are a lot of review comments from your manager in which you are asked to remove some existing content and add new content. You work on review comments and submit the second version of the same document. You are asked to incorporate again some previously removed content. If you have the first version of the document then you can include those removed lines easily. If you don’t have that then you may need to rework the same.
  2. You are writing some critical notes and saving them locally in your system. Just imagine what will happen when your system is crashed on the submission day. You will just lose all your hard work. But if you have saved your work at some different system or cloud location as well then you can easily get the corrupted documents back.
  3. A big team is working on some research tasks. Some are working on individual modules and some are on the shared modules. Just imagine how much collaboration will be difficult.

In all the above scenarios, you required something which can –

  • Keep track/version of progress
  • Provide a shared space to allow people to collaborate
  • Recover if something wrong happened

Above I tried to relate with some real-time scenarios in which we required a VCS. Now we will focus on Software related scenarios for the need for VCS.

The something you required is a Version Control System. You must have used JIRA – Project Tracking Software. JIRA can help you to keep track of all changes done in a story periodically.

There might be a huge code base When we develop software or write automated scripts for testing. Multiple developers will be working on the same project and they will add, delete, and modify script files. If we do not keep track of those changes then we will be in mess. Sharing and merging code might be a nightmare.

All we need above is a Version Control System. It is also called Revision Control, Source Control, or Source Code Management(SCM). GIT is one of them.

Version Control System

A Version Control System is a utility or software which helps us to track and manage changes to a file system or code repo for better collaboration among developers to develop an application. It can keep a history of changes in a file including who has changed and what was changed.

I will give some scenarios below which will help you to understand why we need VCS software.

  1. If multiple developers are working parallelly on the same code repo then how code from all developers will be merged and shared across all developers? It will not be feasible to wait for one developer to finish the coding first and then share the updated code base with another developer.
  2. Suppose the changes from a developer breaks the functionality of an application then It is required to know who has modified the code recently and what was modified. There should be a mechanism which allows us to undo the changes.
  3. Multiple developers can add codes for new features to the same code base at the same time and that can be deployed to different environments to test individually. Merging all those codes will be a challenge.
  4. You have stored code repo in a system and if that system is crashed then you may lose all codes. VCS can help with the backup code in a central or distributed system.
  5. For the DevOps process, storing code in a local system will not help.
  6. Comparing different versions of the same code repo and including what works best is error-prone if done manually.
  7. Code is stored securely and can be accessed by intended users.

There are many numerous scenarios where you really required a VCS which we will see in upcoming posts.

Types of Version Control System

There can be three types of Version Control Systems:-

  1. Local VCS -> Files are stored locally on a system.
  2. Centralized VCS -> Files are stored on a single server.
  3. Distributed VCS -> Files are mirrored with full version history to other systems. Git is a distributed version control system in which repositories are cloned to the developer’s system.

If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe to my YouTube channel.
#ThanksForReading
#HappyLearning

Leave a Reply

Your email address will not be published. Required fields are marked *