Skip to content

What is Version Control?

Abinav Seelan edited this page Aug 30, 2016 · 4 revisions

What is Version Control?

Writing code is a messy affair. There's a lot of trial-and-error. Sometimes introducing a new line of code can completely break your application!

Though the traditional ctrl+z-ing is still a thing...you really can't do it if you have multiple files and/or don't know how much to remove to bring your code back to it's last working state.

This is were a Version Control System (VCS) comes into play. A VCS manages versions of your code so that you can go back and forth between these versions and if a version of your code is wrong and breaks your application, you can just go back to a previous version of the application to bring it back to a working state.

Wait....what? Can you elaborate?

Ok. So imagine you've written some code. Let's name the current state of your code version 1. Now you go ahead and add some more lines of code to this version. Let's call this state version 2. You run your code and your code runs flawlessly. Happy days!

But now you want to add some more code to add some new functionality to your code. This brings your code to a new state. Let's call this version 3. You run the code and...it doesn't run. It breaks. You sad. =(

Now, to fix this, you'd have to go into all the files and see what needs to be undone to bring your code from state version 3 to the perfectly working state version 2. Such hassle!

Now with a Version Control System, things are a little bit easier. The VCS keeps track of these version changes in the form of snapshots of your code. In the above example, when we know that Version 3 of the code isn't working, we can just immediately jump back to the previous version!

Clone this wiki locally