Version Control System - VCS

Post date: Oct 11, 2012 4:15:35 PM

Version Control System (VCS) is a software that allows to manage changes of documents, programs, images and other information that is stored in form of computer files. Changes are usually identified by an incrementing number or letter code also known as revision number or revision.

The simplest usage of versioning is - you can easily go back to the previous working version of your files, should you mess something up with the latest changes.

Changes could range from fixing a typo in a text file up to a huge refactoring in a software project, spanning hundreds of files. Each change usually has name of the person introduced it, time of the change and an optional description message.

Version Control Systems became an essential part of software development due to the following benefits:

    • collaboration - a team of developers (which could be distributed geographically) may be working on the same set of files at once without interrupting each other's work;

    • change management - changes can be inspected, reviewed or rolled back as needed; if you need that App.config file the way it was on May 17, 2008 - no problem;

    • tracking ownership - every change is associated with the name of the person, so we know whom to give kudos to or ask questions;

    • tracking evolution - every change is associated with a short description, so you just need to pull a change log of some class to see how it evolved and who did what;

    • branching - it is possible to create a copy (branch) of the entire project for some specific purpose (i.e.: prototyping or developing a fix for the important customer) without disrupting development workflow;

    • continuous integration - ability to split evolution of a software project into incremental changes allows to run all sorts of checks and tests against each incremental change in a continuous manner.

Common terms:

    • Repository - database server that contains all files and their history.

    • Working copy - local version of files on somebody's machine. It may contain local unversioned changes.

    • Trunk - home folder for some project within the repository. It usually contains all the latest changes.

    • History (or ChangeLog) - a list of changes that were done to a file or folder since it was created.

    • Latest (or Head) - latest available version of some file or folder.

    • Revision - another word that means current version of file or folder.

Common operations:

    • Check out - first operation required to work with any repository. It involves creating working copy that mirrors some folder on the server (usually that's trunk).

    • Commit (or Check In) - sending your local changes back to the server, so that other people can get them as well.

    • Update - updating local working copy to have all the lasted changes that were committed to the server since the last time you've checked it.

    • Revert - discard all your local changes to the working copy.

    • Diff (or Change, Delta) - differences between two versions of the same file; or an operation involving actually looking up what was changed between two versions.

    • Create patch - automatically create a file that describes all the changes that were done to the working copy (basically containing all diffs). Then these changes could be reviewed by somebody else and committed to the repository.

Advanced operations:

    • Conflict - that happens when somebody else changed the file, while you were working on it locally.

    • Resolve - to fix contradicting changes by reviewing and manually merging them (VCSs can automatically resolve majority of the conflicts).

    • Tag - to place a human readable label on some revision (i.e.: when releasing a product); or a noun representing such a label.

    • Branch - to start a separate line of development over some old revision (i.e.: when fixing bugs for the previously released version).

    • Merge - bringing together changes from different sources (i.e.: when applying a bug fix from some branch to a trunk).