This is an old revision of the document!
This page explains how to access a Subversion (svn) repository. This page is primarily for UNIX and Mac (Leopard) users. Windows instructions are here. See this page for setup and administrative information.
On a UNIX system, use
ssh-keygen to create a public/private key pair. Give it a host-specific name (to distinguish it from any other ssh keys you may have) and store it in the default directory (
% ssh-keygen -t rsa -f ~/.ssh/id_rsa_svn1
ssh-keygen will prompt you for a passphrase to lock the key. This protection is not necessary; you can skip it by pressing
ssh-keygen will create two files in your
~/.ssh directory, with the private key in
id_rsa_svn1 and the public key in
Send the repository administrator a copy of your public key file,
id_rsa_svn1.pub, who will then create an svn account for you and tie your public key to that account.
If you're only dealing with this one repository (i.e., you're not involved in any other projects that use svn), then it is simplest to just set the
SVN_SSH environment variable to turn on ssh key access and log you in to the server account. For example, bash users edit
~/.bashrc to include (note that
svn_login is specific to the host where the repository is stored; your administrator should provide this information):
SVN_SSH="ssh -i $HOME/.ssh/id_rsa_svn1 -l svn_login" export SVN_SSH
Once your svn account is created, cd to a suitable directory and get a copy of the repository (
host is also site specific and should be provided by your administrator):
% svn checkout svn+ssh://host.cs.purdue.edu repository
These commands create a
repository subdirectory with a complete copy of the source code repository. The repository may be organized as recommended by the svn community: one directory per “project”, with each project containing a
trunk subdirectory. You'll notice that the repository directory contains two subdirectories: skeletons for “project1” and “project2”. The main place to create files (e.g., source code) is in the
trunk directory. Start there.
The basic steps for adding a new project are to start in the repository directory, make sure you are up-to-date, create the directory structure, add to the project, then commit:
% cd repository % svn update % mkdir project3 project3/branches project3/tags project3/trunk % svn add project3 % svn commit
Create your first file(s) in