Introduction to Version Control
Before Version Control System
When we do work, we often make revisions. For example, when creating a proposal or thesis document.
- Example when writing a thesis:
- Usually we create a π (folder) for example with the name βthesisβ
- Then we start writing in π (file) thesis.docx
- When there is a revision, usually we will create a file with a new version π thesis_revisi-1.docx
- When there is a further revision, we make π thesis_revision-3.docx
- Next π thesis_revisi-4.docx
- π thesis_revision-5.docx
- π thesis_revision-6.docx
- β¦ etc
- Until maybe in the end: π thesis_final_ready_sidang.docx π
- Usually we create a π (folder) for example with the name βthesisβ
- Why do we do this? Of course, so that we know the changes that occur between document revisions. If at any time we need to use the previous revision, we can use it easily.
- As a software developer (developer), it is very natural to revise a lot of code, maybe tens or even hundreds of lines. And this code revision is usually carried out in more than one file.
- By using VCS to manage versions of files, we only need to do it in one file (π thesis.docx), but in that file there are changes from the previous version.
- Imagine if we have made revisions to dozens of files and added features to our code, but not long afterward we are asked to cancel these features. This would be difficult without a VCS. Therefore, letβs get acquainted with VCS further.
What is a Version Control System?
A Version Control System (VCS) is a system that records changes to a file or a set of files of an application program (software) or source code from time to time so that we can look back at the old version someday.
VCS allows us to restore files to a previous state, revert entire projects back to a previous state, compare changes over time, see who last changed something that might have caused a problem and much more.
In short, with VCS, if we make a mistake or lose a file, we can easily recover it.
Why use Version Control
Version control system allows us to collaborate in teams, without losing or overwriting anyoneβs work. After a developer makes a series of changes to the code in one or more files, they tell the VCS to save a representation of those changes.
In this way, a history of code changes or versions is created as the application develops. This history is stored so that all developers, even if they work in different locations, have access to consistent and up-to-date project history.
Benefits of Version Control
Keeping Track of All the Modifications Made to the Code
The team working on the project continues to produce new source code and continues to make changes to the code. These changes are logged for future reference and can be used if needed in the future to find the root cause of a particular issue.
Comparing Earlier Versions of the Code
Because all versions of code are saved, this allows developers to go back at any time and compare previous versions of code to help fix errors and reduce disruption to all team members.
Finally, letβs take a look at some of the best Version Control Systems available today:
Best VCS in the market (Source: simplilearn.com)