Introduction
As the name suggests, Version Control System is a system for maintaining different versions of a codebase.
Let us understand this with an example:
Imagine there is a multinational company which has its offices all over the world with thousands of employees. In such a big company, there will be a set of issues and challenges it may face. So, what could be the possible challenges a company faces?
- Collaboration: There will be so many people located at different offices in a company. There may be a need to communicate for a particular reason or a set of people working on the same project but from other regions.
- Storing versions: A project is not completed in a single version. There may be 'n' number of versions. In that case, the problem of storing all those commits in the same place is a considerable challenge.
- Restoring previous versions: Sometimes, it is essential to go back to the earlier versions to find the root cause of any bug.
- Backup: In case the system or the user's disk breaks down, and there is no backup, all the efforts will go in vain.
As a solution, the version control system comes into the picture!!
Version Control System
Version control refers to software tools that allow developers to look after the changes made to the source code. The system records all the changes made to a file or set of files, so later, a specific version may be called. It is the responsibility of the version control system to keep all the team members on the same wavelength. It makes sure that everyone on the team is working on the latest version of the files and, most importantly, makes sure that all these people can work together simultaneously on the same project.
Let's understand version control with a graphical example:
There are three workstations or developers at three different locations. There is one repository that is acting as a server. The developers are using the repository for either committing or updating the task. Each workstation has its working copy, and all these workstations will be saving their code in a particular server repository. This makes it easy for any developer to access the task being done using the repository. In case the system of any specific developer breaks down, there will be a copy of the source code in the central repository.