Version Control Systems (VCS)
Version Control (also known as Source Control) is a system that records changes to a file or set of files over time so that you can recall specific versions later. A mechanism to track changes to files and maintain a history of everything changed especially useful for developers to manage code changes.
There are two main types of VCS:
Today, an overwhelming majority of developers use Git which is a distributed VCS.
Centralized
Is a single “central” repository that stores history. Everyone pulls and works from this single central repository. Think of it as a common server that everyone has access to and is working from.
Examples
Typical workflow
- Pull down any changes other people have made from the central server.
- Make your changes, and make sure they work properly.
- Commit your changes to the central server, so other programmers can see them.
Pros and cons
Pros
- developers know about other developers activities
- files may be locked down
- easy to administer
- fine-grained control over who can do what
Cons
- single point of failure
- if server goes down, you can’t save versioned changes
- if the server gets corrupted, you lose everything (unless you have good backups)
References
Distributed
The solution to many of the problems of a centralized VCS is a distributed VCS. A distributed VCS is a set of self contained repositories, which can be linked to each other (called remotes). The main difference between centralized VCS and a distributed VCS is that there is no single central repository that controls everything. Rather, there are only working copies of the repository and its history spread out across every persons' machine - including code, revisions, history, versions, etc. There is no single point of failure in this system and users can work completely offline.
Advantages over centralized VCS
- There is no single central repo that controls everything, there are only working copies
- Performing actions other than pushing and pulling changesets is extremely fast because the tool only needs to access the hard drive, not a remote server.
- Committing new changesets can be done locally without anyone else seeing them. Once you have a group of changesets ready, you can push all of them at once.
- Everything but pushing and pulling can be done without an internet connection. So you can work on a plane, and you won’t be forced to commit several bugfixes as one big changeset.
- Since each programmer has a full copy of the project repository, they can share changes with one or two other people at a time if they want to get some feedback before showing the changes to everyone.
Disadvantages over centralized VCS
There are only two major inherent disadvantages to using a distributed system:
- If your project contains many large, binary files that cannot be easily compressed, the space needed to store all versions of these files can accumulate quickly.
- If your project has a very long history (50,000 changesets or more), downloading the entire history can take awhile.
Git
The most widely used distributed version control system is Git. Rizing exclusively uses Git for source control. More can be read about Git in the Source Control docs.