|
Printing Friendly Format
Getting Started with
Subversion
Subversion (a revision control system)
is installed on pluto and wyrd. You can use the system
for your project. This page explains the use of Subversion very
briefly. You may want to look at "Version
Control with Subversion" for further details.
Below is just an example. You can modify the directory structure the way you want.
1.
Creating your Subversion repository
-
Go to the directory where you want to create a repository.
For example, if you want to create a repository in your home directory, type
$
cd This brings you to your home directory. -
Create a repository.
$
svnadmin create repos This creates the repos directory in the
current directory. -
To create top-level directories.
$
svn mkdir file:///home/username/repos/trunk
file:///home/username/repos/branches file:///home/username/repos/tags -m
"creating initial repository layout"
Type all on one line and replace username with your login name above.
This creates three top-level directories in the repos: /trunk to hold the main copy of the project where most development occurs, /branches to hold separate lines of development, and /tags to hold copies of the project as it exists at significant points of time, such as a release. -
To look at the directories just created.
$
svn list file:///home/username/repos
2.
Populating the repositoryThe followings assume that you have your project in the "my-project" directory and you want to bring it into the repository. The repository can be accessible locally and
via the network. If you want to access your repository via
network, you need to configure svn and ssh. Also you need Subversion
client on your side, such as on the ht319 lab machines.
Import your project to the repository.
$ cd my-project
$
svn import . file:///home/username/repos/trunk -m "importing
myproject"
This
imports files in the "my-project" directory to your repository. -m option allows you to associate a message with this import.
-
To look at the files just imported
$
svn list file:///home/username/repos/trunk
-
To
delete a file or a directory from the repository
$svn
delete file:///home/username/repos/trunk/my-project -m "get rid of
extra directory"
-
To
see the content of the file(s) you imported in the repository
$
svn cat file:///home/username/repos/trunk/file_name
Basic
Workflow
-
To check out a working copy. The copy of the files will be managed by Subversion.
For
the local repository
$
svn checkout file:///home/username/repos/trunk my_work
If
you configured svn and ssh to be connected via network, you can
access your repository remotely.
$
svn checkout svn+ssh://user@host_name/home/username/repos/trunk
my_work
-
To modify your working copy, such as editing files and modifying a
directory tree, use the following commands.
$
svn mkdir <target>
$
svn move <source> <distination>
$
svn copy <source> <distination>
$
svn delete <target>
$
svn list <target>
-
To send
your changes to the repository. The following command will create
your directory if it does not exit.
$
svn commit -m "comment here"
-
To
get information on the repository
$
svn info
-
When you are developing software as a group, you may need to update
your working copy to the files modified by someone else. To bring changes from the repository into your working copy:
$ svn update
Graphic Interface
A GUI frontend to the Subversion System, eSvn, is installed on the servers. If you have
X Window System on your side, such as on ht319 lab computers or Cygwin/X,
Exceed (Hummingbird), and
MI/X
(MicroImages) running on MS Windows, you can use svn with GUI. To start eSvn, log on one of the remote servers using ssh and type the following command.
      $
esvn &
|