02. How Version Control Systems Work

In order to fully appreciate Git's features, we should go over the three main types of Version Control Systems.

1) Local Data Models

In the earliest form of version control, developers had to use the same filesystem. Here, a multi-user system, such as UNIX, would have to be necessary to handle multiple users along the filesystem tree.

In one of these models, Revision Control System (RCS), the most current copy of files is stored with patch sets created per change. By summing up these patches and applying them to the files, users were able to recreate the project at any point in time.

2) Centralized Version Control Systems

Although a Local Data Model could work, it was difficult to manage once collaborators across the world joined in on projects. Thus, Centralized Version Control Systems (CVCS, also known as Client-Server Models), were developed. Here, the entire repository lived on a server, and developers checked out the files they wanted to edit. Once they were done with their edits, they would commit them back to the main server.

Centralized version control system.
A Centralized Version Control System. Users could check out files they wanted to work on, then commit them once they made their changes.

By keeping all files in one location, the lead developers controlled exactly who edited which files. However, CVCS's come with a downfall. A server crash or power outage would result in no one being able to work on the project. Scarier is that the entire code base could be wiped out without proper backing up.

Drawbacks of an SVN Version Control System.
A major drawback CVCS is that the server must be up and running in order to work on the code.

3) Distributed Version Control Systems

In order to improve upon all the drawbacks of the previous systems, developers came up with Distributed Version Control Systems (DVCS), where a copy of the entire code base could be stored locally on every contributor's system. This makes files and version control operations increasingly easy to work, as no Internet connection is required to edit any files. Furthermore, if the main repository goes down or is deleted, it can easily be backed up by any local repository.

Distributed Version Control System.
A Distributed Version Control System. Each collaborator has a local copy of the repository, so no Internet connection is required.

When a user wants to make a change to the repository, he or she first commits all changes to his local repository. The developer can then push these changes to the main repository; to keep other developers in sync, they pull them the changes in.

You'll see that Git falls into the category of DVCS. Now let's install Git and get started!

Learn how teams work in Agile

Learning Agile

Learn how teams work in Agile Try Productivity Tools

Agile has revolutionized the way teams approach software development, but with dozens of agile methodologies to choose from, the decision to "go agile" can be tricky. This practical book helps you sort it out, first by grounding you in agile's underlying principles, then by describing four specific and well-used agile methods: Scrum, extreme programming (XP).

$ Check price
44.9944.99Amazon 4.5 logo(25+ reviews)

More Productivity Tools resources

Aching back from coding all day?

Prism Glasses

Aching back from coding all day? Try Back Problems

Ever feel achy from sitting crunched up on your computer table? Try lying down with these optical glasses that allow you to work on your laptop while lying flat on your back. This is the perfect solution with those with limited mobility or those who wish to prevent neck cramps and back strains.

$ Check price
4.454.45Amazon 4 logo(128+ reviews)

More Back Problems resources