Skip to main content

Command Palette

Search for a command to run...

Why does Version Control exist?

Is there any other solution to the pendrive problem?

Updated
8 min read
Why does Version Control exist?

I can’t imagine software development without git just like the LLMs have become such an integral part of the internet. Going back feels slow and chaotic. So was the world without version control systems.

I learned programming after the creation of the git, so I am not the one who has experienced the problems firsthand, like receiving the code through an email or leaving the pendrive sharing, but just like searching the google without AI mode is like coding without git or even using a phone without an AI assistant.

Let’s imagine the world without git. I got an idea to make a web app that just shows me the date and time in real time. I made a project folder name it live-date-and-time , and started working on it. I made an index.html file. Remember, I won’t be able to run git init it in this world as git doesn’t exist in this world.

I scaffold a html with emmet and named the title to Live Date and Time, changed the favicon, visualised the page on the browser and realised I might need the help of a designer friend who is good with CSS, so I copied the project folder into the pendrive and shared it with her.

Later, I shared the code with her, and I can’t see the changes done her live as she will give me the designed code next weekend. I saved my project as live-date-and-time-1.0 . There has been no collaboration and tracking of the changes I have made ever since I started the project.

For her to work on the project, she needs to make a copy of the project on her computer to avoid working on the code I wrote. There is no conflict resolution, and let alone the tracking, as there is no modification tracker. The best thing we could do is add comments, and the code will be filled with comments. I get the code next weekend. If I want some modifications in the design, I will have to wait for some days to get the changes. All that time, either I am not working on the project or spinning copies of the project to work. If even I got the project, I can’t just join the new copy of the project with the old version of mine or undo some changes she did without disturbing her changes, and this point at any moment I can overwrite her code with mine, or she might have overwritten my code with hers.

During this time, I realised while working on spinned copy of my project that I can make my web application more effecient for the getting the time with a feature that mighting an expertise of a friend who is good at JS. I can’t just share the other copy with him, since there is no collaboration between me and my designer friend and me, I can't expect a collaboration with my Interactive friend and me. I will be handing out copied with out having a single source of truth that can verify that it has changed, and this person did it while keeping it all in sync with 3 people at the same time and everyone working with an updated code once other completes their changes. I assume these problems would scale to times when the team size is increased incrementally.

Now, consider that there is something like git exists, and thisis a college project we are working on in a team. We have been assigned this as an assignment. We have allocated a server on the campus with which we can connect and establish a single source of truth for the code, and that has a tracker and a photographic memory inside, which can be shared when we can make a copy of the project on our local system. And we have a main branch for the updates from the server and create branches for working simultaneously on different features with the individual tracking of the changes in the code and then one of us has done their work it can be pulled from the server other’s can update the code from the server with seeing their changes marked with name and reversible to any point on any one’s system and overwriting can be managed and handled carefully.

I can’t imagine software development without Git, just like LLMs have become such an integral part of the internet. Going back feels slow and chaotic, as was the world without version control systems.

I learned programming after the creation of Git, so I have not experienced the problems firsthand, like receiving code through email or using a pendrive for sharing. Just like searching Google without AI mode is like coding without Git or using a phone without an AI assistant.

Let’s imagine a world without Git. I got an idea to make a web app that just shows me the date and time in real-time. I made a project folder and named itlive-date-and-time, and started working on it. I created an index.html file. Remember, I won’t be able to run git init in this world as Git doesn’t exist here.

I scaffolded an HTML with Emmet, named the title "Live Date and Time," changed the favicon, visualised the page on the browser, and realised I might need the help of a designer friend who is good with CSS. So, I copied the project folder onto a pendrive and shared it with her.

Later, I shared the code with her, and I can’t see the changes she made live, as she will give me the designed code next weekend. I saved my project as live-date-and-time-1.0. There is no collaboration and tracking of the changes I made since I started the project.

For her to work on the project, she needs to make a copy of the project on her computer to avoid working on the code I wrote. There is no conflict resolution, let alone tracking, as there is no modification tracker. The best thing we could do is add comments, and the code will be filled with comments. Even when I get the code next weekend, if I want some modifications in the design, I will have to wait for some days to get the changes. All that time, either I am not working on the project or spinning copies of the project to work. Even if I got the project, I can’t just join the new copy of the project with the old version of mine or undo some changes she made without disturbing her changes. At this point, I can overwrite her code with mine, or she might have overwritten my code with hers.

During this time, I realised while working on a spun copy of my project that I can make my web application more efficient by using a feature that might require the expertise of my friend, who is good at JS. I can’t just share the other copy with him. While there is no collaboration between me and my designer friend and me, I can't expect collaboration with my interactive friend. I will be handing out copies without having a single source of truth that can verify what change was made and who did it, while keeping it all in sync with three people at the same time and everyone working with updated code once others complete their changes. I assume these problems would scale when the team size is increased incrementally.

Now, consider that there is something like Git, and this is a college project we are working on as a team. We started this project on the college computer (git init). We have allocated a server on the campus with which we can connect and establish a single source of truth for the code that has a tracker and a photographic memory (snapshot) inside. This can be shared when we make a copy of the project (git clone) on our local system. We have a main branch for the updates (git pull) from the server and create branches (git branch) for working simultaneously on different features with individual tracking of the changes in the code. Then, when one of us has done their work, it can be pushed to the server (git push) and then pulled from the server. Others can update the code from the server, seeing their changes marked with names and reversible to any point on anyone’s system, and overwriting can be managed and handled carefully.

In the above scenario, we saw a system that is distributed, gives individuals a control centre and snapshot mechanism, allows moving back in history, and working on features simultaneously, while switching contexts with branches. Not only one person but many such individuals can work similarly in this simulation with a single source of truth. The copy of that source is on their system, and they can pull and update easily once they learn the basics with some learning curve. It solves for scale as well, without altering the functioning, whether it is one or one thousand, along with a platform for management visually as well.

Here is an image that sums it all

Necessity is the mother of invention, so was Git for the software world when one day the Linux kernel developer community couldn’t access their VCS called BitKeeper. It was to solve a problem of their own, and they later solved it for everyone in the world.