Git Tutorials

What is a version control system?

Let me explain this with a scenario. Suppose you are working on a document. You add writeup to it, do changes and save it. You show this to your colleague. Your colleague suggests you some changes which will make the document better. You do those changes show the document to your boss. Your boss views the document and wants some changes to it. You discover that you had already implemented the changes that your boss asked in the first version of your document, but you have overwritten them and will now have to redo them.

You learn from this experience and decide that you will maintain back up versions of your files just incase you want to revert to the previous changes.

This strategy works well for some time but after a few weeks your desktops is littered with multiple versions of the same file. These files are occupying your hard disk space and you are afraid of deleting any of these as you have lost track of which files are important and which was the final version. Moreover, you are not able to tell what the difference between versions is unless you go through each file. You discover that you have made your life worse.

You wish you would have kept a log of all the changes and somehow should know what the difference between the various versions of file was.

Here comes a version control system to your rescue. Version control systems solves this problem by maintaining your backups in an organized manner abstracted away from you. When backing up your files you need to tell the version control system what changes you have done. Whatever you write will be maintained in the version control system as logs. When you want to retrieve a backup, you can ask the version control system to list all the backups available in it. You can then request for a specific version. The version control system will present you that version of backup and you can also view the logs that you had written while backing up. You can also compare the changes between this version and any other version.

To put it simply, the most basic function of a version control system is to maintain versions of your objects. The objects can be a file, a folder, or multiple folders.

Who should be using a version control system?

Now that we have understood what a version control system is, lets see who should be using it.

Although version control systems originated from the need to efficiently maintain large software project, version control systems can be used by anyone who needs to iterate over a file or a project.

For example, electronics engineers can use it for maintaining their schematics and other PCB CAD files. Architects can use version control systems to maintain versions of their building design. And so on.

What are the various version control system software available?

  • Git
  • SVN (Subversion)
  • Perforce
  • If you are starting out with version control then it is best to start with Git, it is free and there is lots of material available online if you need help. But the single most compelling reason for choosing Git is GitHub. It has so many free and open source project that you can use and learn from.

    A thing worthy of mentioning here is, GitHub and Git are not the same. Git is a version control system software and GitHub is web hosting service that runs Git on its servers and provide it as a service to its users. If you don’t get the difference, don’t worry, just remember that Git is a free and open source software and GitHub is a service provider.