What is Source Control?

So when you are writing a custom component it’s important to understand the Git workflow and basic source control concepts:

Okay - so you are writing code.

You delete a bunch of code accidentally. Oops.

How do you get it back?

In the early days you would have had to remember to back up your code periodically and go back to a back up to find it - if you could. But that is awkward and inefficient.

Why store your entire code with each backup? Why not just store the differences instead with each change which is a much smaller amount of data.

That is the fundamental idea behind source code control. Source code control systems were initially an optimization for software backups by just storing the differences. But as time went on they became much more powerful and convenient because they become like a time machine which makes it possible to see the past history of your code.

Today no one that knows about source code control writes code without source control.

Yes, you can get it for free Creating a Free Bitbucket Account

The very earliest source control systems did not run over networks. When I was writing Chameleon in 1997 I used a very early source control system called RCS which stood for Revision Control System.

RCS was designed for a single programmer to work with which make it quite difficult to work with in a team environment - you would need to put it on to a shared network drive which was not reliable.

Then I switched to using CVS which stood for Concurrent Version System. This was a “client-server” system in that one would have one central server which would store the changes and you would check out code. When you wanted to commit your changes you would have to commit those changes to the server.

Bitkeeper was the first source code control system to switch away from the client-server model of source control to a distributed model.

It was a spectacular innovation in that the inventor Larry McVoy of Bitkeeper figured out how to make it so that when you ‘cloned’ the repository you ended up with a complete self contained copy of the repository on your local computer.

This is what we call a distributed system because it then comes trivial to move the complete repository of source code from one computer to another.

Bitkeeper solved a really big problem for one of the most complicated projects in the world which was Linux kernel development.

It was so good that Linus Torvalds wanted to use it for developing the Linux kernel. This created big political problems since at the time Bitkeeper was not open source software. (today it is).

Linus took two weeks to write the original version of Git since at the time there was no other open source source control system that had the same distributed architecture as Bitkeeper.

There were other competing distributed source code control systems like Mercurial (we used it for a while - didn’t like it - it was slow) and tortoise (we used that in Iguana 5).

Eventually Git become the defacto standard in source control systems that almost everyone uses because of the fact that there is a well established ‘ecosystem’. This makes it a convenient solution.

Bitkeeper is now opensource and could be argued is better engineered but the market has moved on.

If you want more background reading on Git I suggest reading more about GIT concepts in my concepts site.