Why Version Control Exists: The Pendrive Problem

Why Version Control Exists:
The need for version control arises as the complexity of the project continues to increase. The code of the project is not written once; it continues evolving over time. A version control system helps manage the different versions of a project. As the software changes eventually, keeping track of all the versions can be challenging.
The version control system tracks all the changes made to the codebase. When a mistake occurs in the code or a bug is reported, the tracked versions are crucial. They help identify which change in the code led to the bug, making it easier to resolve. It allows you to compare the older version of the code against the newer version, which might have new features added later. It allows developers to revert to a previously stable version in case something goes wrong. The version control system allows multiple developers to collaborate on a project and make their own contributions to the codebase without risking overwrites. The version control system brings accountability to the development process by providing details like the timestamp and the author of the change.
Imagine you are working on a hackathon project and need to add a new feature. This is where the version control system becomes useful, as it saves the last working version of the project. Giving you the freedom to experiment with the feature while keeping the working version safe from any unnecessary changes. The famous version control system 'Git' was developed by Linus Torvalds while working on his ambitious project of the Linux OS. He faced similar problems during development and needed a tool to manage different versions of the project while allowing collaboration among multiple developers. This led to the creation of Git.
The Pendrive Analogy in Software Development
Having started programming before learning about Git, I used to share my program with friends on WhatsApp or upload the zip file of the project to the drive and send them the link. Using this method, my friend would debug the program and send it back to me. It was too time-consuming and inefficient, leading to the classic development problem of having multiple versions of the code like final_v1, final_v2, final_latest and final_latest_latest_v1.
This is where the classic pendrive analogy comes in. A developer writes the code, zips it, and copies it to a pendrive to share with a friend who will work on a new feature or debug and then return the pendrive. The problem arises when trying to identify what changes were made in the code.
A developer writes some code and encounters a bug, then zips the code to share with a friend who is supposed to resolve the bug. He moves the code to a pendrive and shares it with the friend. This friend writes some code and debugs the program, moving it back to the pendrive to share with the first developer. When the first developer opens the code, he sees that the bug has been resolved but is unable to identify what changes were made to the code. Merging the different changes created by two developers becomes even more complex when a third developer joins the project. Coordinating a single pendrive and managing the different versions from these developers is challenging. As the project grows, multiple versions appear, causing confusion about which one actually works.
Day 1 → project
Day 3 → project_final
Day 5 → project_latest_latest_v1
Day 7 → project_final_latest_latest_v1
Which one actually works?
Old Methods Used by Developers
Exchanging project zip files
Carrying code in pendrives between computers
Sending updated files over email
Maintaining backups in shared drives
Keeping multiple folders for safety
Major Problems
Accidental overwriting of teammates’ work
Loss of pendrive leading to complete data loss
Corrupted zip files
No rollback mechanism
No accountability
No safe way to experiment

What Version Control Replaced
Central repository instead of pendrive
Commits instead of renamed folders
Branches instead of duplicate files
Pull/merge instead of manual copy paste

Conclusion
The version control system solves the pendrive chaos by providing a way to track changes made to the code along with the timestamp and author, bringing accountability to the work. Creates a sequential history of all the versions of the project, making it easier to pinpoint any specific change made to the code by any contributor. Today, Git is universally used by developers to manage their code. The pendrive problem wasn't really about storage. It was about lost work, broken collaboration, no history, and no trust in the process. With this understanding of the issues that existed before Git, let's move forward and explore "Git for Beginners: Basics and Essential Commands." Here, we will learn the core commands and workflows of a modern version control system.




