Subversion Howto: Software Development Group Cllrnet
Subversion Howto: Software Development Group Cllrnet
This document will help the understand what subversion is and how to use subversion for their own projects.
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Copyright and License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Disclaimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
What Is SVN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Where To Download SVN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
A Simple Subversion Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Configuring Subversion for Multiple developers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Sample subversion commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Checking out a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Finding the difference between two files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Uploading Changes To Your Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Updating Your Working Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Checking Status Of Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Other Commans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
A. Useful Web Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Introduction
This document will introduce Subversion repository system and why should you use it. Give a sample project and
walk the reader throught it. We will also show the reader how to create a repository were many users can access it, for
project with multiple developers.
Disclaimer
No liability for the contents of this document can be accepted. Use the concepts, examples and information at your
own risk. There may be errors and inaccuracies, that could be damaging to your system. Proceed with caution, and
although it is highly unlikely that accidents will happen because of following advice or procedures described in this
document, the author(s) take no responsibility for damage claimed to be caused by doing so.
All copyrights are held by their respective owners, unless specifically noted otherwise. Use of a term in this document
should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or
brands should not be seen as endorsements. No liability for the contents of this document can be accepted.
1
Subversion
HOWTO
What Is SVN
SVN is the project name for subversion which was developed to replace the Concurrent Version System CVS. For
those people who are less familiar with CVS, CVSis a "source control" or "revision control" tool designed to keep
track of source changes made by groups of developers working on the same files, allowing them to stay in sync with
each other as each individual chooses. The great thing about SVN though is that it has all the same functionality as
CVS, but SVN is designed to be more like a file system rather than a simple revision control.
Subversion have three very good software application that you can use.
• A graphical interface that is embedded into your file explorer. ( TortoiseSVN [http://tortoisesvn.tigris.org])
• Another graphical interface, but this application is can be used on many Operating Systems (RapidSVN
[http://rapidsvn.tigris.org])
Key Features
• time complexity of operation is proportional to the change not the data size
• parseble output
2
Subversion
HOWTO
Subversion stores all versioned data in a control repository to begin, create a new reposity.
# mkdir svnroot
# svnadmin create svnroot/project_name
This command creates a new directory svnroot/project_name which contains a subversion repository. Never
edit this directory manually
• The trunk directory is were you will do most of your work. This directory should contain all you uptodate working
copy of each file needed for the project.
• The branches directory is a copy of the trunk directory but only at a point were you would build a release of your
project.
• The modules directory is where you would devide your project into seperate modules... (plugins) each plugins
would have it’s own (branches/trunk) directories.
Add a group to your linux server and call this group the same name as your project. Add all developer of this project
to that group. Then change the group of each directory and files in your project repository to that group.
Then you will need to change the access bit on all the files and directory in your project’s repository.
3
Subversion
HOWTO
When a developer uses svn localy, he must make sure that he as umask 022 set.
When using using SVN with ssh. You should create a wrapper script so that when svnserver is call it set the umask
022 prior. Here is a sample svnserver script.
#!/sbin/sh
umask 022
/usr/bin/svnserver $*
This command get every file in your repository and store them on your local drive, creating yourself your own working
copy of the project.
Once you have your own working copy of the project. You can start editing any file you want.
The command allows you to see the unified difference between the file in your working copy and the file in the
repository.
# svn ci filename
The checkin command is used when you want to send your changes that you have made to your working copy to your
repository. No mather what command or file you edit, Your reposity will not have been changed unless you execute
this command.
# svn up
4
Subversion
HOWTO
the update command will try to merge all changes into your working copy. Sometime this is not posible and subversion
will let you know by creating a file showing you the difference between the two files.
# svn status
This will show you a list of all your files in your working copy with a character indicating the status of
this file. To a list of all status characters goto Section 4.3.1 of the Subversion book [http://svnbook.red-
bean.com/svnbook/book.html#svn-ch3-sect-4.3.1]
Other Commans
For other svn commands go to: http://svnbook.red-bean.com/svnbook/book.html [http://svnbook.red-
bean.com/svnbook/book.html] or use the help system.
# svn help