What is Source Control?

This section is intended for user's who have never used a source control system before and are wondering what this is all about.


The best way I know of to visualize what a source control system (such as SourceJammer) is for is to think of it as a library. Only instead of an ordinary library where all the books stay the same, a source control system is a library that allows every person who checks out a book to make changes to that book. Then, the next person who checks out the book can see the changes made by all the people who checked out the book before her.


When we use computers to create and modify documents or other types of files as part of a group, we are presented with a strange situation. Where is the "real" copy of the file we are working on?


Suppose you work as part of a team 5 people working on a brochure to advertise your company. One person on the team may have drafted the original brochure and emailed it to the rest of the team for comments and changes. Someone else might have created another version of the same brochure taking a slightly different approach. Then you might edit both versions and email them once again to everyone on the team. Additionally, everyone on the team might be backing up the file somewhere on a shared server.


At this point we've got 40 different copies of the brochure document—the original one drafted, the 4 copies mailed to the rest of the team, the 2nd version drafted, 4 copies of that one mailed to the rest of the team. The 2 edits that you did plus 4 copies of each mailed to the team. And finally 20 backup copies of the 20 files created. So the question is, which of these is the one official "real" version of the file and which are copies? This question becomes very important if all 5 people on your team start making changes to the 40 different documents and the day arrives when you want to publish your brochure. How can you be sure which of the 40 copies to send to the print shop?


One of the primary benefits of source control is to define the one real copy of a file to help avoid this kind of confusion. The "real" version of a file is the one that is in the source control system. All others are copies. Thus, if your team had been using a source control system then it would be easy to know which version of the file to send to the printers. You'd send the one in the source control system. All other versions of the file would be considered unreliable.


A source control system generally has 3 key features:
  1.  It acts as a centralized location for a group of people to store and share files.
  2.  It places controls on who can see, read, and alter files.
  3.  It stores a complete history of all changes made to all files. For example, if a file was changed by John, Jane, and Jose in that order, using a source control system you can see what the file was like after Jose made his changes, before Jose made his changes, before Jane made her changes, and before John made his changes.


Generally, when you use a source control system, you need to tell the system if you want to make a change to a file stored within the system. With SourceJammer, you do this by "checking out" a file. When you check a file out of SourceJammer, no one else can make changes to that file until you have checked the file back in. And once you do check the file in, any changes you made to the file while it was checked out will now be reflected in the file that is stored in SourceJammer.


To continue with the company brochure example, when one member of the team creates the original draft of the brochure, instead of sending to everyone via email, he would add it to SourceJammer and tell everyone on the team how to find the file.


Then, one person at a time on the team could check out the file and make changes and edits. There is no need to email the file around to everyone as long as everyone has access to the SourceJammer server.