Version Control
Edmund Ochieng'
Introduction
Introduction It is also known as revision control or alternatively, as Source Code Management (SCM). ➢ It manages changes to documents and other information stored in the computer as files. ➢ It is mostly used in software development where a software development team may be working on the same files. ➢ Changes are identified by a number or letter termed as a “revision number” or simply as “revision”. ➢ They can work across networks allowing for collaboration. ➢
Merits of Version Control
Why use Version Control? Version Control systems archive old files that may possibly be required for resurrection. ➢ It may also be used when necessary to track changes in files over some time using log files. ➢ Version control manages code minimizing conflict that may result from concurrent altering, difference in coding styles etc. ➢ Allows for rollback in case of erroneous changes made to source code, binary files or a document. ➢
Version Control System types Currently, there are two most widely used version control systems which are both free and open source-the Concurrent Versions System and Subversion, abbreviated as CVS and SVN respectively. ➢ SVN design started in May 2000 under the lead of CollabNet Inc. (http://www.collab.net) as a result of the frustrations of CVS' limitations. ➢
CVS vs. SVN
CVS vs. SVN Despite the fact that SVN is no perfect replacement for CVS, it solves most CVS problems which include but are not limited to: 1. CVS is slower as it sends more information over the network. 2. CVS stores files and nothing else unlike SVN which can store binary and documents as well. 3. CVS has poor internal structure with plenty of historical fixes most of which have been solved in SVN. ➢
CVS vs. SVN (contd.)
For this and other reasons, SVN is found to be better suited for software version control over CVS however, many claim CVS and SVN are incomparable. Doing so, would be like comparing C++ and Java programming languages.
Learning SVN
Subversion components The following are the components of subversion: svn - Command line client program. svnversion -R eports the version of items in the repository. svnadmin - Tool for creating, tweaking or repairing a svn repository.
The Fundamental Problem
How will the System allow users to share information, without interfering with each others work?
File sharing techniques a) Lock-modify-Unlock solution This technique allows one person to modify a file at a time using locks. b) Copy-Modify-Merge solution This technique involves creating a working copy for all svn clients which are merged later on commit.
REFERENCES
References
➢
Version Control with Subversion by Ben Collins-Sussman et al
➢
http://en.wikipedia.org/wiki/Revision_control
➢
http://svnbook.redbean.com
Basic Usage
Basic usage Create a repository This is the process of creating a repository where the projects would be stored. $ svnadmin create /var/svn/repos
Importing a project svn import copies an unversioned copy of files to the repository. $ svn import mytree file:///var/svn/repos/[project] -m "Initial import" Adding mytree/foo.c Adding mytree/bar.c Committed revision 1.
Basic usage(contd.) Initial Checkout Initial checkout involves creating of a working copy of a project. Normally done on the clients system. $ svn+ssh checkout http://192.168.0.120/repos/svn/trunk A mytree/foo.c A mytree/bar.c Checked out revision 1.
There exist a plethora of other commands not covered in this section.
Commit changes