Understanding Version Control System
Tags: git, vcs, opensource, versioncontrolsystem
Published: 2022-03-18 19:31:09

Wrote a code for development, defined variables performed a dry run, and undertook multiple code revisions only to discover that the previously written code was better than the latest one. Reverting to the previous code well is not an easy thing to do. At times, it was a difficult task on the developer's end.

The **modification, update, reversion** formulated **Version Control System**. Version Control System keeps track of files modification, deletion of files, or folder in a working director.
Let's discuss the version control Systems more in detail.

## Version Control System

What is **Version Control System?** Essentially, Version Control Systems allows recording changes to files over time to view specific versions of those files later on.

Version Control Systems, or VCS, are specialized software. The primary purpose is to manage the codebase changes whenever changes are applied. Also, with the help of a _Version Control System_, we can recall a specific version later.

## Why do you need one?

Did you work on a project that required recalling the specific changes made to each file? If yes, how did you manage and control each version? Maybe tried to duplicate and rename the files with suffixes like **“review,” “fixed,” or “final”**, as shown in the below image.

![Why we need Git](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tns0euslbixw4yia4ppz.png)

All those problems can solve by using a Version Control System or VCS. A Version Control System tracks each change made to every project file and provides a simple way to compare and roll back those changes.

## Types of Version Control system
Version Control Systems have three types, which are following.

**1. Local Version Control System**
**2. Centralized Version Control System**
**3. Distributed Version Control System**

### Local Version Control System

In the **Local Version Control System**, the user manages and controls all the file changes within the local system. All changes are saved in a local database. Revision Control system (RCS) is one of the most common Versions Control System tools. As seen in the image below, each developer has their version control history, and they are only limited to the local databases.


![Local Version Control System](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ruhlws0e5fi468fcds1y.png)


### Centralized Version Control System

A **Centralized Version Control System** contains one repository in which users have stored a working copy of the project they are working on. Users need to commit their changes to the repository to update and reflect its changes.

![Centralized Version Control System](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j9vr4j6ppd5etbiacf5b.png)
### Distributed Version Control System

A **Distributed Version Control System** contains multiple repositories. All users have their repositories and working copies. Committing the changes will not give other users access to the changes because the commit will only reflect in the local repository. The user needs to push the changes to the central repository. The most popular distributed version control systems are **Git** and **Mercurial**. 

![Distributed Version Control System](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bthgl1k5ecc02xpz0xa4.png)

## Benefits of Version Control System

These are the benefits of the version control system.

1. Using a Version Control System allows collaboration between the team, and users can easily contribute to the codebase simultaneously without overwriting or conflicting with each other works.

2. The Version Control System also enables developers to quickly revert the codebase changes to the last good state in case of any bug or software failure.

3. **Distributed Version Control Systems** like **_Git_** can restore the entire project and the history from any developer's local repository if the central repository is lost or deleted.

## Why do we use git?

According to the 2021 survey of **StackOverflow**, 90% of developers use Git, making it the most used distributed version control system in the world. Git is used to tracking changes in a project file.
According to the 2021 survey, 90% of developers use Git, making it the most used distributed version control system in the world. 
These are the few reasons developers prefer Git to other distributed version control systems.

1. Developers can easily track their entire timeline of any project's changes, decisions, and progressions from a single repository. They can access their project history, and the developer has all the context they need to understand it and start contributing to the open-source world.

2. With the help of Git, developers can quickly work in every time zone. Team collaboration can efficiently maintain source code integrity. Using branches, developers can safely propose changes to the production environment.

## Summary

**Git** has many more powerful features covered throughout this course.
We learned about the version control systems and types of different version control systems from this lesson. In the next lesson, we will learn about the basics fundamentals of Git, Installations, Configurations, and basic commands to get started.

If you have any question, please feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/adilshehzad7/).  

* [Understanding Git]()
* [Back to Main]()