Version Control
An Introduction
Prof. David Bernstein
James Madison University
Computer Science Department
bernstdh@jmu.edu
Introduction
Motivation:
We need to manage documents (code, documentation, etc...) that are created by numerous people and change over time
We need to manage the documents for multiple products/projects and multiple variations of those products/projects
Other Names:
Revision Control
Source Control
Some Important Concepts
Repository:
An "official" collection of documents/files
Working Copy:
A copy (outside of a repository) of a document/file (the collection of which may be in a
working tree
on the file system)
Check-Out:
Making a working copy
Check-In/Commit:
Adding/returning a file to the repository
Approaches
Locking/Exclusivity/Single Check-Out:
Only one person can check a file out at a time
Other people can still view the file
Nobody else can check the file in (until the original person has done so)
Multiple Check-Outs:
Multiple people can check-out the same file
The first check-in always succeeds
Subsequent check-ins have to be merged (sometimes manually)
Architecture
Centralized/Client-Server:
There is a a single, authoritative repository
Distributed/Peer-to-Peer:
Every peer has a repository
Repositories must be synchronized at some point
Some Terminology
Branches/Forks:
Copies that will change in different ways in the future (e.g., products being developed for different platforms but have the same origin)
Change/Diff/Delta:
A particular modification
Change List/Update/Patch/Commit:
An atomic set of changes
Conflict:
Changes that can not be reconciled automatically (and, hence, must be
resolved
)
Head/Tip:
The most recent commit to either the trunk or a branch
Trunk:
The original code and revisions (i.e., before the first branch/fork)
Some Examples
The Early Systems:
Source Code Control System (SCCS) -- 1972, Marc Rochkind, Bell Labs
Revision Control System (RCS) -- 1982, Walter Tichy, Purdue
Concurrent Versioning System (CVS):
Released in 1986 (Dick Grune)
Centralized, Exclusive
Non-atomic (i.e., doesn't have "all or nothing" transactions)
Some Examples (cont.)
Subversion
:
Centralized, Multiple Check-Out
Released in 2001
Conceived as a replacement for CVS
Git
:
Distributed, Multiple Check-Out
Released in 2005
Based on experience with BitKeeper (which was used to develop the Linux kernel but stopped being free)
Initiated by Linus Torvalds
Mercurial:
Distributed, Multiple Check-Out
Released in 2005
Based on experience with BitKeeper (which was used to develop the Linux kernel but stopped being free)
Initiated by Matt Mackall