Traveling Back in Time With Source Control
Everyone makes mistakes, sometimes we wish to go back in time and fix things we’ve done wrong. Unfortunately that is not possible in real life. In the world of programming, you can go back and forth and change anything you want. To make this possible, you need a version control system (VCS).
There are many different VCSs out there, most of which you will never use, but they generally fall into one of two groups.
- Distributed VCS – distributed systems don’t have centralized repository, instead every user has his own fully functional clone. Distributes systems are usually much faster, since they can work on your local machine.
- Centralized VCS – the main difference here is that centralized VCS has one repository, which is accessible via network and everyone works with that one particular repository.
All version control systems work in a very similar way. Every time you make some modifications to your project, you commit them to your repository. This will create a new snapshot of your whole project.
Here comes the killer feature of all VCSs. You can go back to any commit you made in the past, or just compare it to your actual working version to see what has changed since then. This way, you don’t have to ever worry about breaking something while implementing a new feature. If you find out that you a made terrible mistake and the whole project is unstable, you can just go back to last working commit.
Sounds awesome? That’s just a tiny bit of what VCS can do.