Revised 2014 Sep 2: - Added revert/checkout (undoing changes)
Also called revision control systems, source control systems, etc. Originally but not necessarily always for computer software source code.
Goals:
For example, if you’re currently working on version 2.5.6, and someone reports a bug in version 1.2.3, which you’re still supporting, you need to be able to recreate version 1.2.3 to reproduce, diagnose, and fix the bug.
With file locking, only a single developer can check out a file for editing at one time. Version merging allows multiple developers to do so, and their changes have to be somehow merged when committed or checked din.
The disadvantages of a centralized system with the client/server model are that every operation you perform with the version control system requires access to the server. Therefore, it can be slow, due to network lag, or impossible, due to network inaccesibility.
Most newer version control systems therefore tend to take the distributed approach. Each developer’s computer contains a “complete” repository and the whole version control software — not just the current snapshot. The developer can therefore work on the project without network access. Of course, sharing changes does require network access, and there is often a central project site, such as on GitHub, for sharing.
I have never used SCCS or RCS.
My first experience was with CVS. Since Subversion claimed to be “a better CVS” or “CVS done right,” I switched to it. In both of these I found branching and merging hard.
Since then, I have used darcs and (occasionally, with much frustration) git.
Create project in working directory:
$ darcs init
Get an existing project (“checkout”):
$ darcs get REPO_PATH
Add files to project:
$ darcs add FILE ...
See what’s changed:
$ darcs whatsnew [-l]
Record changes (local “checkin”):
$ darcs record [--all]
Go back to last recorded version:
$ darcs revert FILE ...
Label the current version with a tag:
$ darcs tag VERSION_LABEL
See the history of changes:
$ darcs changes
Share changes (makes “checkin” non-local):
$ darcs push [REPO_PATH]
Get changes from collaborators:
$ darcs pull [REPO_PATH]
[Setup:
]
Participatory demonstration
$ man darcs$ darcs help [command]See the slides for more information about git.